[FFmpeg-devel,07/27] avfilter/mjpegdec: replace YUVJ pixel formats

Submitted by Paul B Mahol on Dec. 9, 2017, 3:37 p.m.

Details

Message ID 20171209153819.19007-7-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Dec. 9, 2017, 3:37 p.m.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/mjpegdec.c                | 18 +++++++++---------
 libavcodec/tdsc.c                    |  2 +-
 tests/fate/filter-video.mak          |  2 +-
 tests/fate/vcodec.mak                |  4 ++--
 tests/ref/fate/api-mjpeg-codec-param |  4 ++--
 tests/ref/fate/exif-image-embedded   |  2 +-
 tests/ref/fate/exif-image-jpg        |  2 +-
 7 files changed, 17 insertions(+), 17 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index e005dd0cd3..55676d8576 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -467,7 +467,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
             if (s->component_id[0] == 'Q' && s->component_id[1] == 'F' && s->component_id[2] == 'A') {
                 s->avctx->pix_fmt = s->bits <= 8 ? AV_PIX_FMT_GBRP : AV_PIX_FMT_GBRP16;
             } else {
-                if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+                if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
                 else              s->avctx->pix_fmt = AV_PIX_FMT_YUV444P16;
             s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
             }
@@ -509,7 +509,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     case 0x22122100:
     case 0x21211100:
     case 0x22211200:
-        if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+        if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
         else
             goto unk_pixfmt;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -517,7 +517,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     case 0x22221100:
     case 0x22112200:
     case 0x11222200:
-        if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+        if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
         else
             goto unk_pixfmt;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -549,7 +549,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
         } else {
             if (pix_fmt_id == 0x14111100)
                 s->upscale_v[1] = s->upscale_v[2] = 1;
-            if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV440P : AV_PIX_FMT_YUVJ440P;
+            if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV440P;
             else
                 goto unk_pixfmt;
             s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -562,7 +562,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
                 goto unk_pixfmt;
             s->upscale_h[0] = s->upscale_h[1] = 1;
         } else {
-            if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+            if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
             else              s->avctx->pix_fmt = AV_PIX_FMT_YUV422P16;
             s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
         }
@@ -570,13 +570,13 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     case 0x31111100:
         if (s->bits > 8)
             goto unk_pixfmt;
-        s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV444P : AV_PIX_FMT_YUVJ444P;
+        s->avctx->pix_fmt = AV_PIX_FMT_YUV444P;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
         s->upscale_h[1] = s->upscale_h[2] = 2;
         break;
     case 0x22121100:
     case 0x22111200:
-        if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV422P : AV_PIX_FMT_YUVJ422P;
+        if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV422P;
         else
             goto unk_pixfmt;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
@@ -584,7 +584,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
     case 0x22111100:
     case 0x42111100:
     case 0x24111100:
-        if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV420P : AV_PIX_FMT_YUVJ420P;
+        if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV420P;
         else              s->avctx->pix_fmt = AV_PIX_FMT_YUV420P16;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
         if (pix_fmt_id == 0x42111100) {
@@ -598,7 +598,7 @@  int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
         }
         break;
     case 0x41111100:
-        if (s->bits <= 8) s->avctx->pix_fmt = s->cs_itu601 ? AV_PIX_FMT_YUV411P : AV_PIX_FMT_YUVJ411P;
+        if (s->bits <= 8) s->avctx->pix_fmt = AV_PIX_FMT_YUV411P;
         else
             goto unk_pixfmt;
         s->avctx->color_range = s->cs_itu601 ? AVCOL_RANGE_MPEG : AVCOL_RANGE_JPEG;
diff --git a/libavcodec/tdsc.c b/libavcodec/tdsc.c
index 4182404cf0..af92ef6ccc 100644
--- a/libavcodec/tdsc.c
+++ b/libavcodec/tdsc.c
@@ -357,7 +357,7 @@  static int tdsc_decode_jpeg_tile(AVCodecContext *avctx, int tile_size,
     }
 
     ret = avcodec_receive_frame(ctx->jpeg_avctx, ctx->jpgframe);
-    if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUVJ420P) {
+    if (ret < 0 || ctx->jpgframe->format != AV_PIX_FMT_YUV420P) {
         av_log(avctx, AV_LOG_ERROR,
                "JPEG decoding error (%d).\n", ret);
 
diff --git a/tests/fate/filter-video.mak b/tests/fate/filter-video.mak
index c19f301ff8..6be869df9f 100644
--- a/tests/fate/filter-video.mak
+++ b/tests/fate/filter-video.mak
@@ -1,5 +1,5 @@ 
 FATE_FILTER_SAMPLES-$(call ALLYES, SMJPEG_DEMUXER MJPEG_DECODER PERMS_FILTER OWDENOISE_FILTER) += fate-filter-owdenoise-sample
-fate-filter-owdenoise-sample: CMD = ffmpeg -idct simple -i $(TARGET_SAMPLES)/smjpeg/scenwin.mjpg -vf "trim=duration=0.5,perms=random,owdenoise=10:20:20:enable=not(between(t\,0.2\,1.2))" -an -f rawvideo -
+fate-filter-owdenoise-sample: CMD = ffmpeg -idct simple -i $(TARGET_SAMPLES)/smjpeg/scenwin.mjpg -vf "trim=duration=0.5,perms=random,owdenoise=10:20:20:enable=not(between(t\,0.2\,1.2))" -color_range tv -an -f rawvideo -
 fate-filter-owdenoise-sample: REF = $(TARGET_SAMPLES)/filter-reference/owdenoise-scenwin.raw
 fate-filter-owdenoise-sample: CMP_TARGET = 1
 fate-filter-owdenoise-sample: FUZZ = 3539
diff --git a/tests/fate/vcodec.mak b/tests/fate/vcodec.mak
index bbcf25d72a..72fc46e83b 100644
--- a/tests/fate/vcodec.mak
+++ b/tests/fate/vcodec.mak
@@ -4,8 +4,8 @@  fate-vsynth_lena-%: SRC = tests/data/vsynth_lena.yuv
 fate-vsynth3-%: SRC = tests/data/vsynth3.yuv
 fate-vsynth%: CODEC = $(word 3, $(subst -, ,$(@)))
 fate-vsynth%: FMT = avi
-fate-vsynth%: CMD = enc_dec "rawvideo -s 352x288 -pix_fmt yuv420p $(RAWDECOPTS)" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s 352x288 -pix_fmt yuv420p -vsync 0 $(DECOPTS)" -keep "$(DECINOPTS)"
-fate-vsynth3-%: CMD = enc_dec "rawvideo -s $(FATEW)x$(FATEH) -pix_fmt yuv420p $(RAWDECOPTS)" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s $(FATEW)x$(FATEH) -pix_fmt yuv420p -vsync 0 $(DECOPTS)" -keep "$(DECINOPTS)"
+fate-vsynth%: CMD = enc_dec "rawvideo -s 352x288 -color_range tv -pix_fmt yuv420p $(RAWDECOPTS)" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s 352x288 -pix_fmt yuv420p -color_range tv -vsync 0 $(DECOPTS)" -keep "$(DECINOPTS)"
+fate-vsynth3-%: CMD = enc_dec "rawvideo -s $(FATEW)x$(FATEH) -color_range tv -pix_fmt yuv420p $(RAWDECOPTS)" $(SRC) $(FMT) "-c $(CODEC) $(ENCOPTS)" rawvideo "-s $(FATEW)x$(FATEH) -pix_fmt yuv420p -color_range tv -vsync 0 $(DECOPTS)" -keep "$(DECINOPTS)"
 fate-vsynth%: CMP_UNIT = 1
 fate-vsynth%: REF = $(SRC_PATH)/tests/ref/vsynth/$(@:fate-%=%)
 
diff --git a/tests/ref/fate/api-mjpeg-codec-param b/tests/ref/fate/api-mjpeg-codec-param
index 178b7c73cb..0ef9594b40 100644
--- a/tests/ref/fate/api-mjpeg-codec-param
+++ b/tests/ref/fate/api-mjpeg-codec-param
@@ -133,7 +133,7 @@  stream=0, decode=0
     field_order=0
     dump_separator=
     codec_whitelist=
-    pixel_format=yuvj422p
+    pixel_format=yuv422p
     video_size=400x225
     max_pixels=2147483647
     hwaccel_flags=0x00000001
@@ -272,7 +272,7 @@  stream=0, decode=1
     field_order=0
     dump_separator=
     codec_whitelist=
-    pixel_format=yuvj422p
+    pixel_format=yuv422p
     video_size=400x225
     max_pixels=2147483647
     hwaccel_flags=0x00000001
diff --git a/tests/ref/fate/exif-image-embedded b/tests/ref/fate/exif-image-embedded
index 306ae0854b..582f09dfb6 100644
--- a/tests/ref/fate/exif-image-embedded
+++ b/tests/ref/fate/exif-image-embedded
@@ -14,7 +14,7 @@  pkt_pos=N/A
 pkt_size=15760
 width=263
 height=263
-pix_fmt=yuvj420p
+pix_fmt=yuv420p
 sample_aspect_ratio=1:1
 pict_type=I
 coded_picture_number=0
diff --git a/tests/ref/fate/exif-image-jpg b/tests/ref/fate/exif-image-jpg
index b266501191..6b3dbb3319 100644
--- a/tests/ref/fate/exif-image-jpg
+++ b/tests/ref/fate/exif-image-jpg
@@ -14,7 +14,7 @@  pkt_pos=N/A
 pkt_size=46095
 width=400
 height=225
-pix_fmt=yuvj422p
+pix_fmt=yuv422p
 sample_aspect_ratio=1:1
 pict_type=I
 coded_picture_number=0