annotate dnxhdenc.h @ 8917:422a9dbebb53 libavcodec

Almost cosmetics. Move some assignments after the checks.
author iive
date Sun, 15 Feb 2009 10:14:16 +0000
parents bf6a78c6697b
children 19a4f1ecd8fe
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8294
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
1 /*
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
2 * VC3/DNxHD encoder structure definitions and prototypes
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
3 * Copyright (c) 2007 Baptiste Coudurier <baptiste dot coudurier at smartjog dot com>
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
4 *
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
5 * VC-3 encoder funded by the British Broadcasting Corporation
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
6 *
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
7 * This file is part of FFmpeg.
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
8 *
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
9 * FFmpeg is free software; you can redistribute it and/or
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
10 * modify it under the terms of the GNU Lesser General Public
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
11 * License as published by the Free Software Foundation; either
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
12 * version 2.1 of the License, or (at your option) any later version.
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
13 *
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
14 * FFmpeg is distributed in the hope that it will be useful,
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
17 * Lesser General Public License for more details.
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
18 *
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
19 * You should have received a copy of the GNU Lesser General Public
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
20 * License along with FFmpeg; if not, write to the Free Software
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
22 */
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
23
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
24 #ifndef AVCODEC_DNXHDENC_H
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
25 #define AVCODEC_DNXHDENC_H
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
26
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
27 #include <stdint.h>
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
28 #include "libavcodec/mpegvideo.h"
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
29 #include "libavcodec/dnxhddata.h"
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
30
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
31 typedef struct {
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
32 uint16_t mb;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
33 int value;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
34 } RCCMPEntry;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
35
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
36 typedef struct {
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
37 int ssd;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
38 int bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
39 } RCEntry;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
40
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
41 typedef struct DNXHDEncContext {
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
42 MpegEncContext m; ///< Used for quantization dsp functions
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
43
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
44 AVFrame frame;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
45 int cid;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
46 const CIDEntry *cid_table;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
47 uint8_t *msip; ///< Macroblock Scan Indexes Payload
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
48 uint32_t *slice_size;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
49
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
50 struct DNXHDEncContext *thread[MAX_THREADS];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
51
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
52 unsigned dct_y_offset;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
53 unsigned dct_uv_offset;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
54 int interlaced;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
55 int cur_field;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
56
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
57 DECLARE_ALIGNED_16(DCTELEM, blocks[8][64]);
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
58
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
59 int (*qmatrix_c) [64];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
60 int (*qmatrix_l) [64];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
61 uint16_t (*qmatrix_l16)[2][64];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
62 uint16_t (*qmatrix_c16)[2][64];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
63
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
64 unsigned frame_bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
65 uint8_t *src[3];
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
66
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
67 uint32_t *vlc_codes;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
68 uint8_t *vlc_bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
69 uint16_t *run_codes;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
70 uint8_t *run_bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
71
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
72 /** Rate control */
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
73 unsigned slice_bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
74 unsigned qscale;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
75 unsigned lambda;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
76
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
77 unsigned thread_size;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
78
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
79 uint16_t *mb_bits;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
80 uint8_t *mb_qscale;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
81
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
82 RCCMPEntry *mb_cmp;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
83 RCEntry (*mb_rc)[8160];
8303
bf6a78c6697b dnxhd get_pixels_8x4_sym sse2
bcoudurier
parents: 8294
diff changeset
84
bf6a78c6697b dnxhd get_pixels_8x4_sym sse2
bcoudurier
parents: 8294
diff changeset
85 void (*get_pixels_8x4_sym)(DCTELEM */*align 16*/, const uint8_t *, int);
8294
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
86 } DNXHDEncContext;
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
87
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
88 void ff_dnxhd_init_mmx(DNXHDEncContext *ctx);
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
89
f92b595af7eb move structure definitions in their own header
bcoudurier
parents:
diff changeset
90 #endif /* AVCODEC_DNXHDENC_H */