FFmpeg
avs3.h
Go to the documentation of this file.
1 /*
2  * AVS3 related definitions
3  *
4  * Copyright (C) 2020 Huiwen Ren, <hwrenx@gmail.com>
5  *
6  * This file is part of FFmpeg.
7  *
8  * FFmpeg is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * FFmpeg is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with FFmpeg; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21  */
22 
23 #ifndef AVCODEC_AVS3_H
24 #define AVCODEC_AVS3_H
25 
26 #define AVS3_NAL_START_CODE 0x010000
27 #define AVS3_SEQ_START_CODE 0xB0
28 #define AVS3_SEQ_END_CODE 0xB1
29 #define AVS3_USER_DATA_START_CODE 0xB2
30 #define AVS3_INTRA_PIC_START_CODE 0xB3
31 #define AVS3_UNDEF_START_CODE 0xB4
32 #define AVS3_EXTENSION_START_CODE 0xB5
33 #define AVS3_INTER_PIC_START_CODE 0xB6
34 #define AVS3_VIDEO_EDIT_CODE 0xB7
35 #define AVS3_FIRST_SLICE_START_CODE 0x00
36 #define AVS3_PROFILE_BASELINE_MAIN 0x20
37 #define AVS3_PROFILE_BASELINE_MAIN10 0x22
38 
39 #define AVS3_ISPIC(x) ((x) == AVS3_INTRA_PIC_START_CODE || (x) == AVS3_INTER_PIC_START_CODE)
40 #define AVS3_ISUNIT(x) ((x) == AVS3_SEQ_START_CODE || AVS3_ISPIC(x))
41 
42 #include "libavutil/avutil.h"
43 #include "libavutil/pixfmt.h"
44 #include "libavutil/rational.h"
45 
46 static const AVRational ff_avs3_frame_rate_tab[16] = {
47  { 0 , 0 }, // forbid
48  { 24000, 1001},
49  { 24 , 1 },
50  { 25 , 1 },
51  { 30000, 1001},
52  { 30 , 1 },
53  { 50 , 1 },
54  { 60000, 1001},
55  { 60 , 1 },
56  { 100 , 1 },
57  { 120 , 1 },
58  { 200 , 1 },
59  { 240 , 1 },
60  { 300 , 1 },
61  { 0 , 0 }, // reserved
62  { 0 , 0 } // reserved
63 };
64 
65 static const int ff_avs3_color_primaries_tab[10] = {
66  AVCOL_PRI_RESERVED0 , // 0
67  AVCOL_PRI_BT709 , // 1
69  AVCOL_PRI_RESERVED , // 3
70  AVCOL_PRI_BT470M , // 4
71  AVCOL_PRI_BT470BG , // 5
72  AVCOL_PRI_SMPTE170M , // 6
73  AVCOL_PRI_SMPTE240M , // 7
74  AVCOL_PRI_FILM , // 8
75  AVCOL_PRI_BT2020 // 9
76 };
77 
78 static const int ff_avs3_color_transfer_tab[15] = {
79  AVCOL_TRC_RESERVED0 , // 0
80  AVCOL_TRC_BT709 , // 1
82  AVCOL_TRC_RESERVED , // 3
83  AVCOL_TRC_GAMMA22 , // 4
84  AVCOL_TRC_GAMMA28 , // 5
85  AVCOL_TRC_SMPTE170M , // 6
86  AVCOL_TRC_SMPTE240M , // 7
87  AVCOL_TRC_LINEAR , // 8
88  AVCOL_TRC_LOG , // 9
89  AVCOL_TRC_LOG_SQRT , // 10
90  AVCOL_TRC_BT2020_12 , // 11
91  AVCOL_TRC_SMPTE2084 , // 12
92  AVCOL_TRC_UNSPECIFIED , // 13
94 };
95 
96 static const int ff_avs3_color_matrix_tab[12] = {
97  AVCOL_SPC_RESERVED , // 0
98  AVCOL_SPC_BT709 , // 1
100  AVCOL_SPC_RESERVED , // 3
101  AVCOL_SPC_FCC , // 4
102  AVCOL_SPC_BT470BG , // 5
103  AVCOL_SPC_SMPTE170M , // 6
104  AVCOL_SPC_SMPTE240M , // 7
105  AVCOL_SPC_BT2020_NCL , // 8
106  AVCOL_SPC_BT2020_CL , // 9
107  AVCOL_SPC_UNSPECIFIED , // 10
109 };
110 
111 static const enum AVPictureType ff_avs3_image_type[4] = {
116 };
117 
118 #endif /* AVCODEC_AVS3_H */
AVCOL_PRI_RESERVED
@ AVCOL_PRI_RESERVED
Definition: pixfmt.h:569
AVCOL_TRC_LINEAR
@ AVCOL_TRC_LINEAR
"Linear transfer characteristics"
Definition: pixfmt.h:599
AVPictureType
AVPictureType
Definition: avutil.h:277
rational.h
AVCOL_TRC_UNSPECIFIED
@ AVCOL_TRC_UNSPECIFIED
Definition: pixfmt.h:593
AVCOL_TRC_BT2020_12
@ AVCOL_TRC_BT2020_12
ITU-R BT2020 for 12-bit system.
Definition: pixfmt.h:606
AVCOL_SPC_BT2020_CL
@ AVCOL_SPC_BT2020_CL
ITU-R BT2020 constant luminance system.
Definition: pixfmt.h:631
AVCOL_SPC_BT470BG
@ AVCOL_SPC_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
Definition: pixfmt.h:625
AVCOL_SPC_RESERVED
@ AVCOL_SPC_RESERVED
reserved for future use by ITU-T and ISO/IEC just like 15-255 are
Definition: pixfmt.h:623
AVCOL_TRC_GAMMA28
@ AVCOL_TRC_GAMMA28
also ITU-R BT470BG
Definition: pixfmt.h:596
AVCOL_TRC_LOG_SQRT
@ AVCOL_TRC_LOG_SQRT
"Logarithmic transfer characteristic (100 * Sqrt(10) : 1 range)"
Definition: pixfmt.h:601
AVCOL_TRC_GAMMA22
@ AVCOL_TRC_GAMMA22
also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:595
AVCOL_PRI_RESERVED0
@ AVCOL_PRI_RESERVED0
Definition: pixfmt.h:566
AVCOL_SPC_SMPTE170M
@ AVCOL_SPC_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
Definition: pixfmt.h:626
AVCOL_PRI_SMPTE240M
@ AVCOL_PRI_SMPTE240M
identical to above, also called "SMPTE C" even though it uses D65
Definition: pixfmt.h:574
AVCOL_PRI_UNSPECIFIED
@ AVCOL_PRI_UNSPECIFIED
Definition: pixfmt.h:568
AVCOL_PRI_BT470BG
@ AVCOL_PRI_BT470BG
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
Definition: pixfmt.h:572
AVCOL_PRI_SMPTE170M
@ AVCOL_PRI_SMPTE170M
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
Definition: pixfmt.h:573
AVCOL_TRC_RESERVED0
@ AVCOL_TRC_RESERVED0
Definition: pixfmt.h:591
ff_avs3_color_matrix_tab
static const int ff_avs3_color_matrix_tab[12]
Definition: avs3.h:96
AVRational
Rational number (pair of numerator and denominator).
Definition: rational.h:58
AVCOL_PRI_BT709
@ AVCOL_PRI_BT709
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP 177 Annex B
Definition: pixfmt.h:567
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:279
AVCOL_PRI_BT2020
@ AVCOL_PRI_BT2020
ITU-R BT2020.
Definition: pixfmt.h:576
ff_avs3_color_primaries_tab
static const int ff_avs3_color_primaries_tab[10]
Definition: avs3.h:65
AVCOL_TRC_SMPTE2084
@ AVCOL_TRC_SMPTE2084
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: pixfmt.h:607
AVCOL_TRC_SMPTE240M
@ AVCOL_TRC_SMPTE240M
Definition: pixfmt.h:598
AVCOL_PRI_FILM
@ AVCOL_PRI_FILM
colour filters using Illuminant C
Definition: pixfmt.h:575
AVCOL_TRC_LOG
@ AVCOL_TRC_LOG
"Logarithmic transfer characteristic (100:1 range)"
Definition: pixfmt.h:600
ff_avs3_frame_rate_tab
static const AVRational ff_avs3_frame_rate_tab[16]
Definition: avs3.h:46
AV_PICTURE_TYPE_NONE
@ AV_PICTURE_TYPE_NONE
Undefined.
Definition: avutil.h:278
ff_avs3_image_type
static enum AVPictureType ff_avs3_image_type[4]
Definition: avs3.h:111
AVCOL_TRC_BT709
@ AVCOL_TRC_BT709
also ITU-R BT1361
Definition: pixfmt.h:592
AVCOL_SPC_SMPTE240M
@ AVCOL_SPC_SMPTE240M
derived from 170M primaries and D65 white point, 170M is derived from BT470 System M's primaries
Definition: pixfmt.h:627
AVCOL_SPC_BT2020_NCL
@ AVCOL_SPC_BT2020_NCL
ITU-R BT2020 non-constant luminance system.
Definition: pixfmt.h:630
AVCOL_SPC_UNSPECIFIED
@ AVCOL_SPC_UNSPECIFIED
Definition: pixfmt.h:622
ff_avs3_color_transfer_tab
static const int ff_avs3_color_transfer_tab[15]
Definition: avs3.h:78
AVCOL_PRI_BT470M
@ AVCOL_PRI_BT470M
also FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:570
pixfmt.h
AVCOL_TRC_ARIB_STD_B67
@ AVCOL_TRC_ARIB_STD_B67
ARIB STD-B67, known as "Hybrid log-gamma".
Definition: pixfmt.h:611
AV_PICTURE_TYPE_B
@ AV_PICTURE_TYPE_B
Bi-dir predicted.
Definition: avutil.h:281
AVCOL_SPC_FCC
@ AVCOL_SPC_FCC
FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
Definition: pixfmt.h:624
AVCOL_TRC_SMPTE170M
@ AVCOL_TRC_SMPTE170M
also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
Definition: pixfmt.h:597
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:280
avutil.h
AVCOL_TRC_RESERVED
@ AVCOL_TRC_RESERVED
Definition: pixfmt.h:594
AVCOL_SPC_BT709
@ AVCOL_SPC_BT709
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / derived in SMPTE RP 177 Annex B
Definition: pixfmt.h:621