History

avcodec/mjpegenc: Use forward decl for MpegEncContext, MJpegHuffmanCode

Avoids an indirect inclusion of mpegvideo.h in mjpegenc_common.c.

Andreas Rheinhardt committed 1 year ago

Commit 455ca921 parent 85138c12 files · +17 −16Browse files

Unified · Split

2 files
  1. libavcodec/mjpegenc.c +14 −0
  2. libavcodec/mjpegenc.h +3 −16
libavcodec/mjpegenc.c+14−0
@@ -45,6 +45,20 @@ · 44 unmodified lines
4545 #include "mpegvideoenc.h"
4646 #include "profiles.h"
4747
48+/**
49+ * Buffer of JPEG frame data.
50+ *
51+ * Optimal Huffman table generation requires the frame data to be loaded into
52+ * a buffer so that the tables can be computed.
53+ * There are at most mb_width*mb_height*12*64 of these per frame.
54+ */
55+typedef struct MJpegHuffmanCode {
56+ // 0=DC lum, 1=DC chrom, 2=AC lum, 3=AC chrom
57+ uint8_t table_id; ///< The Huffman table id associated with the data.
58+ uint8_t code; ///< The exponent.
59+ uint16_t mant; ///< The mantissa.
60+} MJpegHuffmanCode;
61+
4862 /* The following is the private context of MJPEG/AMV decoder.
4963 * Note that when using slice threading only the main thread's
5064 * MpegEncContext is followed by a MjpegContext; the other threads
libavcodec/mjpegenc.h+3−16
@@ -36,23 +36,8 @@ · 35 unmodified lines
3636 #include <stdint.h>
3737
3838 #include "mjpeg.h"
39−#include "mpegvideo.h"
4039 #include "put_bits.h"
4140
42−/**
43− * Buffer of JPEG frame data.
44− *
45− * Optimal Huffman table generation requires the frame data to be loaded into
46− * a buffer so that the tables can be computed.
47− * There are at most mb_width*mb_height*12*64 of these per frame.
48− */
49−typedef struct MJpegHuffmanCode {
50− // 0=DC lum, 1=DC chrom, 2=AC lum, 3=AC chrom
51− uint8_t table_id; ///< The Huffman table id associated with the data.
52− uint8_t code; ///< The exponent.
53− uint16_t mant; ///< The mantissa.
54−} MJpegHuffmanCode;
55−
5641 /**
5742 * Holds JPEG frame data and Huffman table data.
5843 */
@@ -89,7 +74,7 @@ typedef struct MJpegContext { · 30 unmodified lines
8974 uint8_t val_ac_chrominance[256]; ///< AC chrominance Huffman values.
9075
9176 size_t huff_ncode; ///< Number of current entries in the buffer.
92− MJpegHuffmanCode *huff_buffer; ///< Buffer for Huffman code values.
77+ struct MJpegHuffmanCode *huff_buffer; ///< Buffer for Huffman code values.
9378 } MJpegContext;
9479
9580 /**
@@ -107,6 +92,8 @@ static inline void put_marker(PutBitContext *p, enum JpegMarker code) · 11 unmodified lines
10792 put_bits(p, 8, code);
10893 }
10994
95+typedef struct MpegEncContext MpegEncContext;
96+
11097 int ff_mjpeg_encode_init(MpegEncContext *s);
11198 void ff_mjpeg_amv_encode_picture_header(MpegEncContext *s);
11299 void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t