diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-12-07 17:36:22 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-12-10 21:15:27 +0100 |
commit | 05086a6c936c360a43db38b11b5074fb0cb65211 (patch) | |
tree | fc29e69890474c1eae3034ea6800cd95bc639ba4 /libavcodec/mjpegdec.h | |
parent | ec2d582cb02dc3b838b2ff9efe48a5fa2ee288dd (diff) | |
download | ffmpeg-05086a6c936c360a43db38b11b5074fb0cb65211.tar.gz |
avcodec/mjpegdec: Only use receive_frame for SMVJPEG
Only one codec using mjpegdec.c actually creates multiple
frames from a single packet, namely SMVJPEG. The other can
use the ordinary decode callback just fine. This e.g. has
the advantage of confining the special SP5X/AMV code to sp5xdec.c.
This reverts most of commit e9a2a8777317d91af658f774c68442ac4aa726ec;
of course it is not a simple revert: Way too much has changed;
furthermore, outright reverting the sp5xdec.c changes would readd
a stack packet to sp5x_decode_frame() which is not desired.
In order to avoid this without modifying the given AVPacket,
a variant of ff_mjpeg_decode_frame() with explicit buf and size
parameters has been added.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mjpegdec.h')
-rw-r--r-- | libavcodec/mjpegdec.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libavcodec/mjpegdec.h b/libavcodec/mjpegdec.h index 2cb218902c..13c524d597 100644 --- a/libavcodec/mjpegdec.h +++ b/libavcodec/mjpegdec.h @@ -57,8 +57,6 @@ typedef struct MJpegDecodeContext { GetBitContext gb; int buf_size; - AVPacket *pkt; - int start_code; /* current start code */ int buffer_size; uint8_t *buffer; @@ -173,7 +171,12 @@ int ff_mjpeg_build_vlc(VLC *vlc, const uint8_t *bits_table, const uint8_t *val_table, int is_ac, void *logctx); int ff_mjpeg_decode_init(AVCodecContext *avctx); int ff_mjpeg_decode_end(AVCodecContext *avctx); -int ff_mjpeg_receive_frame(AVCodecContext *avctx, AVFrame *frame); +int ff_mjpeg_decode_frame(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + AVPacket *avpkt); +int ff_mjpeg_decode_frame_from_buf(AVCodecContext *avctx, + AVFrame *frame, int *got_frame, + const AVPacket *avpkt, const uint8_t *buf, int buf_size); int ff_mjpeg_decode_dqt(MJpegDecodeContext *s); int ff_mjpeg_decode_dht(MJpegDecodeContext *s); int ff_mjpeg_decode_sof(MJpegDecodeContext *s); @@ -184,6 +187,4 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s, const uint8_t **buf_ptr, const uint8_t *buf_end, const uint8_t **unescaped_buf_ptr, int *unescaped_buf_size); -int ff_sp5x_process_packet(AVCodecContext *avctx, AVPacket *avpkt); - #endif /* AVCODEC_MJPEGDEC_H */ |