#include "libavutil/pixdesc.h"
#include "avcodec.h"
-#include "dsputil.h"
+#include "idctdsp.h"
#include "internal.h"
+#include "jpegtables.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];
{
LJpegEncContext *s = avctx->priv_data;
- av_frame_free(&avctx->coded_frame);
av_freep(&s->scratch);
return 0;
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 "
return AVERROR(EINVAL);
}
- avctx->coded_frame = av_frame_alloc();
- if (!avctx->coded_frame)
- return AVERROR(ENOMEM);
-
+#if FF_API_CODED_FRAME
+FF_DISABLE_DEPRECATION_WARNINGS
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
avctx->coded_frame->key_frame = 1;
+FF_ENABLE_DEPRECATION_WARNINGS
+#endif
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);