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
45#include "mpegvideoenc.h"45#include "mpegvideoenc.h"
46#include "profiles.h"46#include "profiles.h"
47 47
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 */
55typedef 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
48/* The following is the private context of MJPEG/AMV decoder.62/* The following is the private context of MJPEG/AMV decoder.
49 * Note that when using slice threading only the main thread's63 * Note that when using slice threading only the main thread's
50 * MpegEncContext is followed by a MjpegContext; the other threads64 * MpegEncContext is followed by a MjpegContext; the other threads
libavcodec/mjpegenc.h+3−16
@@ -36,23 +36,8 @@ · 35 unmodified lines
36#include <stdint.h>36#include <stdint.h>
37 37
38#include "mjpeg.h"38#include "mjpeg.h"
39#include "mpegvideo.h"
40#include "put_bits.h"39#include "put_bits.h"
41 40
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 */
49typedef 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
56/**41/**
57 * Holds JPEG frame data and Huffman table data.42 * Holds JPEG frame data and Huffman table data.
58 */43 */
@@ -89,7 +74,7 @@ typedef struct MJpegContext { · 30 unmodified lines
89 uint8_t val_ac_chrominance[256]; ///< AC chrominance Huffman values.74 uint8_t val_ac_chrominance[256]; ///< AC chrominance Huffman values.
90 75
91 size_t huff_ncode; ///< Number of current entries in the buffer.76 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.
93} MJpegContext;78} MJpegContext;
94 79
95/**80/**
@@ -107,6 +92,8 @@ static inline void put_marker(PutBitContext *p, enum JpegMarker code) · 11 unmodified lines
107 put_bits(p, 8, code);92 put_bits(p, 8, code);
108}93}
109 94
95typedef struct MpegEncContext MpegEncContext;
96
110int ff_mjpeg_encode_init(MpegEncContext *s);97int ff_mjpeg_encode_init(MpegEncContext *s);
111void ff_mjpeg_amv_encode_picture_header(MpegEncContext *s);98void ff_mjpeg_amv_encode_picture_header(MpegEncContext *s);
112void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);99void 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