diff mbox series

[FFmpeg-devel,1/4] mjpegdec: stop setting the QP table

Message ID 20210126170102.15175-1-anton@khirnov.net
State Accepted
Commit fffc35b870ea3b11689dd1ff871dbcf288462569
Headers show
Series [FFmpeg-devel,1/4] mjpegdec: stop setting the QP table | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Anton Khirnov Jan. 26, 2021, 5 p.m. UTC
MJPEG does not have a single quantiser scale, so this does not fit into
the intended API use.

This removes the last use of the long-deprecated QP table API.
---
 libavcodec/mjpegdec.c              | 11 ++---------
 tests/ref/fate/exif-image-embedded |  6 ------
 tests/ref/fate/exif-image-jpg      |  6 ------
 3 files changed, 2 insertions(+), 21 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index a32eb36064..d6bd5aedb5 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -2611,19 +2611,12 @@  eoi_parser:
 
             frame->pkt_dts = s->pkt->dts;
 
-            if (!s->lossless) {
+            if (!s->lossless && avctx->debug & FF_DEBUG_QP) {
                 int qp = FFMAX3(s->qscale[0],
                                 s->qscale[1],
                                 s->qscale[2]);
-                int qpw = (s->width + 15) / 16;
-                AVBufferRef *qp_table_buf = av_buffer_alloc(qpw);
-                if (qp_table_buf) {
-                    memset(qp_table_buf->data, qp, qpw);
-                    av_frame_set_qp_table(frame, qp_table_buf, 0, FF_QSCALE_TYPE_MPEG1);
-                }
 
-                if(avctx->debug & FF_DEBUG_QP)
-                    av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", qp);
+                av_log(avctx, AV_LOG_DEBUG, "QP: %d\n", qp);
             }
 
             goto the_end;
diff --git a/tests/ref/fate/exif-image-embedded b/tests/ref/fate/exif-image-embedded
index d9239b3c83..9ad073e9ea 100644
--- a/tests/ref/fate/exif-image-embedded
+++ b/tests/ref/fate/exif-image-embedded
@@ -29,12 +29,6 @@  color_transfer=unknown
 chroma_location=center
 TAG:UserComment=AppleMark
 
-[SIDE_DATA]
-side_data_type=QP table data
-[/SIDE_DATA]
-[SIDE_DATA]
-side_data_type=QP table properties
-[/SIDE_DATA]
 [/FRAME]
 [FRAME]
 media_type=audio
diff --git a/tests/ref/fate/exif-image-jpg b/tests/ref/fate/exif-image-jpg
index eb18dede21..b266501191 100644
--- a/tests/ref/fate/exif-image-jpg
+++ b/tests/ref/fate/exif-image-jpg
@@ -229,10 +229,4 @@  TAG:ExposureMode=    0
 TAG:WhiteBalance=    0
 TAG:DigitalZoomRatio=   4000:4000
 TAG:SceneCaptureType=    0
-[SIDE_DATA]
-side_data_type=QP table data
-[/SIDE_DATA]
-[SIDE_DATA]
-side_data_type=QP table properties
-[/SIDE_DATA]
 [/FRAME]