1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

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.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2025-03-04 16:44:15 +01:00
parent 85138c1434
commit 455ca92b31
2 changed files with 17 additions and 16 deletions

View File

@ -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

View File

@ -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]);