]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ljpegenc.c
ac3enc: allow Dolby Pro Logic IIz as the Dolby Surround EX mode.
[ffmpeg] / libavcodec / ljpegenc.c
index 7eb4675768e06374bdf7e65f788f22c93fa7ce96..fbb024b9a6266a9ee7ed21c17c5eec4d4e237892 100644 (file)
 #include "libavutil/pixdesc.h"
 
 #include "avcodec.h"
-#include "dsputil.h"
+#include "idctdsp.h"
 #include "internal.h"
+#include "mjpegenc_common.h"
 #include "mpegvideo.h"
 #include "mjpeg.h"
 #include "mjpegenc.h"
 
 typedef struct LJpegEncContext {
-    DSPContext dsp;
+    IDCTDSPContext idsp;
     ScanTable scantable;
     uint16_t matrix[64];
 
@@ -266,7 +267,8 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
 
     if ((avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
          avctx->pix_fmt == AV_PIX_FMT_YUV422P ||
-         avctx->pix_fmt == AV_PIX_FMT_YUV444P) &&
+         avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
+         avctx->color_range == AVCOL_RANGE_MPEG) &&
         avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) {
         av_log(avctx, AV_LOG_ERROR,
                "Limited range YUV is non-standard, set strict_std_compliance to "
@@ -283,8 +285,9 @@ static av_cold int ljpeg_encode_init(AVCodecContext *avctx)
 
     s->scratch = av_malloc_array(avctx->width + 1, sizeof(*s->scratch));
 
-    ff_dsputil_init(&s->dsp, avctx);
-    ff_init_scantable(s->dsp.idct_permutation, &s->scantable, ff_zigzag_direct);
+    ff_idctdsp_init(&s->idsp, avctx);
+    ff_init_scantable(s->idsp.idct_permutation, &s->scantable,
+                      ff_zigzag_direct);
 
     av_pix_fmt_get_chroma_sub_sample(avctx->pix_fmt, &chroma_h_shift,
                                      &chroma_v_shift);
@@ -329,6 +332,6 @@ AVCodec ff_ljpeg_encoder = {
                                                     AV_PIX_FMT_BGR24,
                                                     AV_PIX_FMT_YUV420P,
                                                     AV_PIX_FMT_YUV422P,
-                                                    AV_PIX_FMT_YUVJ444P,
+                                                    AV_PIX_FMT_YUV444P,
                                                     AV_PIX_FMT_NONE },
 };