xref: /third_party/ffmpeg/libavcodec/h264data.h (revision cabdff1a)
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#ifndef AVCODEC_H264DATA_H
20#define AVCODEC_H264DATA_H
21
22#include <stdint.h>
23
24#include "libavutil/rational.h"
25#include "h264.h"
26
27extern const uint8_t ff_h264_golomb_to_pict_type[5];
28extern const uint8_t ff_h264_golomb_to_intra4x4_cbp[48];
29extern const uint8_t ff_h264_golomb_to_inter_cbp[48];
30
31extern const uint8_t ff_h264_chroma_dc_scan[4];
32extern const uint8_t ff_h264_chroma422_dc_scan[8];
33
34typedef struct IMbInfo {
35    uint16_t type;
36    uint8_t pred_mode;
37    uint8_t cbp;
38} IMbInfo;
39
40extern const IMbInfo ff_h264_i_mb_type_info[26];
41
42typedef struct PMbInfo {
43    uint16_t type;
44    uint8_t partition_count;
45} PMbInfo;
46
47extern const PMbInfo ff_h264_p_mb_type_info[5];
48extern const PMbInfo ff_h264_p_sub_mb_type_info[4];
49extern const PMbInfo ff_h264_b_mb_type_info[23];
50extern const PMbInfo ff_h264_b_sub_mb_type_info[13];
51
52static const AVRational ff_h264_pixel_aspect[17] = {
53    {   0,  1 },
54    {   1,  1 },
55    {  12, 11 },
56    {  10, 11 },
57    {  16, 11 },
58    {  40, 33 },
59    {  24, 11 },
60    {  20, 11 },
61    {  32, 11 },
62    {  80, 33 },
63    {  18, 11 },
64    {  15, 11 },
65    {  64, 33 },
66    { 160, 99 },
67    {   4,  3 },
68    {   3,  2 },
69    {   2,  1 },
70};
71
72extern const uint8_t ff_h264_dequant4_coeff_init[6][3];
73extern const uint8_t ff_h264_dequant8_coeff_init_scan[16];
74extern const uint8_t ff_h264_dequant8_coeff_init[6][6];
75extern const uint8_t ff_h264_quant_rem6[QP_MAX_NUM + 1];
76extern const uint8_t ff_h264_quant_div6[QP_MAX_NUM + 1];
77
78extern const uint8_t ff_h264_chroma_qp[7][QP_MAX_NUM + 1];
79
80#endif /* AVCODEC_H264DATA_H */
81