FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cbs_internal.h
Go to the documentation of this file.
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_CBS_INTERNAL_H
20 #define AVCODEC_CBS_INTERNAL_H
21 
22 #include "avcodec.h"
23 #include "cbs.h"
24 #include "get_bits.h"
25 #include "put_bits.h"
26 
27 
28 typedef struct CodedBitstreamType {
30 
32 
33  // Split frag->data into coded bitstream units, creating the
34  // frag->units array. Fill data but not content on each unit.
35  // header is set if the fragment came from a header block, which
36  // may require different parsing for some codecs (e.g. the AVCC
37  // header in H.264).
40  int header);
41 
42  // Read the unit->data bitstream and decompose it, creating
43  // unit->content.
45  CodedBitstreamUnit *unit);
46 
47  // Write the unit->data bitstream from unit->content.
49  CodedBitstreamUnit *unit);
50 
51  // Read the data from all of frag->units and assemble it into
52  // a bitstream for the whole fragment.
55 
56  // Free the content and data of a single unit.
58 
59  // Free the codec internal state.
62 
63 
64 // Helper functions for trace output.
65 
67  const char *name);
68 
70  int position, const char *name,
71  const char *bitstring, int64_t value);
72 
73 
74 // Helper functions for read/write of common bitstream elements, including
75 // generation of trace output.
76 
78  int width, const char *name, uint32_t *write_to,
79  uint32_t range_min, uint32_t range_max);
80 
82  int width, const char *name, uint32_t value,
83  uint32_t range_min, uint32_t range_max);
84 
85 
89 
90 
91 #endif /* AVCODEC_CBS_INTERNAL_H */
void(* close)(CodedBitstreamContext *ctx)
Definition: cbs_internal.h:60
void ff_cbs_trace_syntax_element(CodedBitstreamContext *ctx, int position, const char *name, const char *bitstring, int64_t value)
Definition: cbs.c:297
bitstream reader API header.
Coded bitstream unit structure.
Definition: cbs.h:61
void ff_cbs_trace_header(CodedBitstreamContext *ctx, const char *name)
Definition: cbs.c:288
static const uint8_t header[24]
Definition: sdr2.c:67
AVCodecID
Identify the syntax and semantics of the bitstream.
Definition: avcodec.h:215
int(* split_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag, int header)
Definition: cbs_internal.h:38
uint16_t width
Definition: gdv.c:47
int(* read_unit)(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_internal.h:44
const CodedBitstreamType ff_cbs_type_mpeg2
Definition: cbs_mpeg2.c:402
int(* assemble_fragment)(CodedBitstreamContext *ctx, CodedBitstreamFragment *frag)
Definition: cbs_internal.h:53
void(* free_unit)(CodedBitstreamUnit *unit)
Definition: cbs_internal.h:57
typedef void(APIENTRY *FF_PFNGLACTIVETEXTUREPROC)(GLenum texture)
GLsizei GLboolean const GLfloat * value
Definition: opengl_enc.c:109
AVFormatContext * ctx
Definition: movenc.c:48
Libavcodec external API header.
Coded bitstream fragment structure, combining one or more units.
Definition: cbs.h:108
Context structure for coded bitstream operations.
Definition: cbs.h:145
const CodedBitstreamType ff_cbs_type_h265
Definition: cbs_h2645.c:1407
enum AVCodecID codec_id
Definition: cbs_internal.h:29
int ff_cbs_read_unsigned(CodedBitstreamContext *ctx, GetBitContext *gbc, int width, const char *name, uint32_t *write_to, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:321
int
const CodedBitstreamType ff_cbs_type_h264
Definition: cbs_h2645.c:1393
int ff_cbs_write_unsigned(CodedBitstreamContext *ctx, PutBitContext *pbc, int width, const char *name, uint32_t value, uint32_t range_min, uint32_t range_max)
Definition: cbs.c:362
const char * name
Definition: opengl_enc.c:103
int(* write_unit)(CodedBitstreamContext *ctx, CodedBitstreamUnit *unit)
Definition: cbs_internal.h:48
bitstream writer API