ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | 
Fri Feb 28 00:05:28 2025 +0100| [137060d586ab69ed253dbeb13aff33e368172523] | 
committer: Andreas Rheinhardt

avcodec/mpegvideo_enc: Move q_scale_type check to mpeg12enc.c

The MPEG-2 encoder is the only encoder supporting q_scale_type.

Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=137060d586ab69ed253dbeb13aff33e368172523
---

 libavcodec/mpeg12enc.c     | 8 ++++++++
 libavcodec/mpegvideo_enc.c | 8 --------
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index 52264ac6a0..90baf1ed95 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -201,6 +201,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
         }
     }
 
+    if (mpeg12->mpeg.q_scale_type == 1) {
+        if (avctx->qmax > 28) {
+            av_log(avctx, AV_LOG_ERROR,
+                   "non linear quant only supports qmax <= 28 currently\n");
+            return AVERROR_PATCHWELCOME;
+        }
+    }
+
     if (avctx->profile == AV_PROFILE_UNKNOWN) {
         if (avctx->level != AV_LEVEL_UNKNOWN) {
             av_log(avctx, AV_LOG_ERROR, "Set profile and level\n");
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 5eea676dd4..da9247ec25 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -705,14 +705,6 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
         }
     }
 
-    if (s->q_scale_type == 1) {
-        if (avctx->qmax > 28) {
-            av_log(avctx, AV_LOG_ERROR,
-                   "non linear quant only supports qmax <= 28 currently\n");
-            return AVERROR_PATCHWELCOME;
-        }
-    }
-
     if (avctx->slices > 1 &&
         !(avctx->codec->capabilities & AV_CODEC_CAP_SLICE_THREADS)) {
         av_log(avctx, AV_LOG_ERROR, "Multiple slices are not supported by this 
codec\n");

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to