ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinha...@outlook.com> | Tue Mar 4 16:44:15 2025 +0100| [455ca92b31bfd68959040220d5c239818dab8680] | committer: Andreas Rheinhardt
avcodec/mjpegenc: Use forward decl for MpegEncContext, MJpegHuffmanCode Avoids an indirect inclusion of mpegvideo.h in mjpegenc_common.c. Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@outlook.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=455ca92b31bfd68959040220d5c239818dab8680 --- libavcodec/mjpegenc.c | 14 ++++++++++++++ libavcodec/mjpegenc.h | 19 +++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index cd8eb8f6c1..38d5ad3a11 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -45,6 +45,20 @@ #include "mpegvideoenc.h" #include "profiles.h" +/** + * Buffer of JPEG frame data. + * + * Optimal Huffman table generation requires the frame data to be loaded into + * a buffer so that the tables can be computed. + * There are at most mb_width*mb_height*12*64 of these per frame. + */ +typedef struct MJpegHuffmanCode { + // 0=DC lum, 1=DC chrom, 2=AC lum, 3=AC chrom + uint8_t table_id; ///< The Huffman table id associated with the data. + uint8_t code; ///< The exponent. + uint16_t mant; ///< The mantissa. +} MJpegHuffmanCode; + /* The following is the private context of MJPEG/AMV decoder. * Note that when using slice threading only the main thread's * MpegEncContext is followed by a MjpegContext; the other threads diff --git a/libavcodec/mjpegenc.h b/libavcodec/mjpegenc.h index a593b67e96..1ac0d6de7e 100644 --- a/libavcodec/mjpegenc.h +++ b/libavcodec/mjpegenc.h @@ -36,23 +36,8 @@ #include <stdint.h> #include "mjpeg.h" -#include "mpegvideo.h" #include "put_bits.h" -/** - * Buffer of JPEG frame data. - * - * Optimal Huffman table generation requires the frame data to be loaded into - * a buffer so that the tables can be computed. - * There are at most mb_width*mb_height*12*64 of these per frame. - */ -typedef struct MJpegHuffmanCode { - // 0=DC lum, 1=DC chrom, 2=AC lum, 3=AC chrom - uint8_t table_id; ///< The Huffman table id associated with the data. - uint8_t code; ///< The exponent. - uint16_t mant; ///< The mantissa. -} MJpegHuffmanCode; - /** * Holds JPEG frame data and Huffman table data. */ @@ -89,7 +74,7 @@ typedef struct MJpegContext { uint8_t val_ac_chrominance[256]; ///< AC chrominance Huffman values. size_t huff_ncode; ///< Number of current entries in the buffer. - MJpegHuffmanCode *huff_buffer; ///< Buffer for Huffman code values. + struct MJpegHuffmanCode *huff_buffer; ///< Buffer for Huffman code values. } MJpegContext; /** @@ -107,6 +92,8 @@ static inline void put_marker(PutBitContext *p, enum JpegMarker code) put_bits(p, 8, code); } +typedef struct MpegEncContext MpegEncContext; + int ff_mjpeg_encode_init(MpegEncContext *s); void ff_mjpeg_amv_encode_picture_header(MpegEncContext *s); void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]); _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog To unsubscribe, visit link above, or email ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".