FFmpeg
libaomdec.c
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010, Google, Inc.
3  *
4  * This file is part of FFmpeg.
5  *
6  * FFmpeg is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * FFmpeg is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with FFmpeg; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /**
22  * @file
23  * AV1 decoder support via libaom
24  */
25 
26 #include <aom/aom_decoder.h>
27 #include <aom/aomdx.h>
28 
29 #include "libavutil/common.h"
30 #include "libavutil/cpu.h"
32 #include "libavutil/imgutils.h"
33 
34 #include "avcodec.h"
35 #include "bytestream.h"
36 #include "codec_internal.h"
37 #include "decode.h"
38 #include "itut35.h"
39 #include "libaom.h"
40 #include "profiles.h"
41 
42 typedef struct AV1DecodeContext {
43  struct aom_codec_ctx decoder;
45 
46 static av_cold int aom_init(AVCodecContext *avctx,
47  const struct aom_codec_iface *iface)
48 {
49  AV1DecodeContext *ctx = avctx->priv_data;
50  struct aom_codec_dec_cfg deccfg = {
51  .threads = FFMIN(avctx->thread_count ? avctx->thread_count : av_cpu_count(), 16)
52  };
53 
54  av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_version_str());
55  av_log(avctx, AV_LOG_VERBOSE, "%s\n", aom_codec_build_config());
56 
57  if (aom_codec_dec_init(&ctx->decoder, iface, &deccfg, 0) != AOM_CODEC_OK) {
58  const char *error = aom_codec_error(&ctx->decoder);
59  av_log(avctx, AV_LOG_ERROR, "Failed to initialize decoder: %s\n",
60  error);
61  return AVERROR(EINVAL);
62  }
63 
64  return 0;
65 }
66 
67 // returns 0 on success, AVERROR_INVALIDDATA otherwise
68 static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
69 {
70  static const enum AVColorRange color_ranges[] = {
72  };
73  avctx->color_range = color_ranges[img->range];
74  if (img->cp != AOM_CICP_CP_UNSPECIFIED)
75  avctx->color_primaries = (enum AVColorPrimaries)img->cp;
76  if (img->mc != AOM_CICP_MC_UNSPECIFIED)
77  avctx->colorspace = (enum AVColorSpace)img->mc;
78  if (img->tc != AOM_CICP_TC_UNSPECIFIED)
79  avctx->color_trc = (enum AVColorTransferCharacteristic)img->tc;
80 
81  switch (img->fmt) {
82  case AOM_IMG_FMT_I420:
83  case AOM_IMG_FMT_I42016:
84  if (img->bit_depth == 8) {
85  avctx->pix_fmt = img->monochrome ?
88  return 0;
89  } else if (img->bit_depth == 10) {
90  avctx->pix_fmt = img->monochrome ?
93  return 0;
94  } else if (img->bit_depth == 12) {
95  avctx->pix_fmt = img->monochrome ?
98  return 0;
99  } else {
100  return AVERROR_INVALIDDATA;
101  }
102  case AOM_IMG_FMT_I422:
103  case AOM_IMG_FMT_I42216:
104  if (img->bit_depth == 8) {
105  avctx->pix_fmt = AV_PIX_FMT_YUV422P;
107  return 0;
108  } else if (img->bit_depth == 10) {
109  avctx->pix_fmt = AV_PIX_FMT_YUV422P10;
111  return 0;
112  } else if (img->bit_depth == 12) {
113  avctx->pix_fmt = AV_PIX_FMT_YUV422P12;
115  return 0;
116  } else {
117  return AVERROR_INVALIDDATA;
118  }
119  case AOM_IMG_FMT_I444:
120  case AOM_IMG_FMT_I44416:
121  if (img->bit_depth == 8) {
122  avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
124  avctx->profile = AV_PROFILE_AV1_HIGH;
125  return 0;
126  } else if (img->bit_depth == 10) {
127  avctx->pix_fmt = AV_PIX_FMT_YUV444P10;
128  avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
130  avctx->profile = AV_PROFILE_AV1_HIGH;
131  return 0;
132  } else if (img->bit_depth == 12) {
133  avctx->pix_fmt = avctx->colorspace == AVCOL_SPC_RGB ?
136  return 0;
137  } else {
138  return AVERROR_INVALIDDATA;
139  }
140 
141  default:
142  return AVERROR_INVALIDDATA;
143  }
144 }
145 
147  const uint8_t *buffer, size_t buffer_size)
148 {
149  if (buffer_size < 6)
150  return AVERROR(EINVAL);
151 
152  GetByteContext bc;
153  bytestream2_init(&bc, buffer, buffer_size);
154 
155  const int country_code = bytestream2_get_byteu(&bc);
156  const int provider_code = bytestream2_get_be16u(&bc);
157  const int provider_oriented_code = bytestream2_get_be16u(&bc);
158  const int application_identifier = bytestream2_get_byteu(&bc);
159 
160  // See "HDR10+ AV1 Metadata Handling Specification" v1.0.1, Section 2.1.
161  if (country_code == ITU_T_T35_COUNTRY_CODE_US
162  && provider_code == ITU_T_T35_PROVIDER_CODE_SAMSUNG
163  && provider_oriented_code == 0x0001
164  && application_identifier == 0x04) {
165  // HDR10+
167  if (!hdr_plus)
168  return AVERROR(ENOMEM);
169 
170  int res = av_dynamic_hdr_plus_from_t35(hdr_plus, bc.buffer,
172  if (res < 0)
173  return res;
174  }
175 
176  return 0;
177 }
178 
179 static int decode_metadata(AVFrame *frame, const struct aom_image *img)
180 {
181  const size_t num_metadata = aom_img_num_metadata(img);
182  for (size_t i = 0; i < num_metadata; ++i) {
183  const aom_metadata_t *metadata = aom_img_get_metadata(img, i);
184  if (!metadata)
185  continue;
186 
187  switch (metadata->type) {
188  case OBU_METADATA_TYPE_ITUT_T35: {
189  int res = decode_metadata_itu_t_t35(frame, metadata->payload, metadata->sz);
190  if (res < 0)
191  return res;
192  break;
193  }
194  default:
195  break;
196  }
197  }
198  return 0;
199 }
200 
201 static int aom_decode(AVCodecContext *avctx, AVFrame *picture,
202  int *got_frame, AVPacket *avpkt)
203 {
204  AV1DecodeContext *ctx = avctx->priv_data;
205  const void *iter = NULL;
206  struct aom_image *img;
207  int ret;
208 
209  if (aom_codec_decode(&ctx->decoder, avpkt->data, avpkt->size, NULL) !=
210  AOM_CODEC_OK) {
211  const char *error = aom_codec_error(&ctx->decoder);
212  const char *detail = aom_codec_error_detail(&ctx->decoder);
213 
214  av_log(avctx, AV_LOG_ERROR, "Failed to decode frame: %s\n", error);
215  if (detail)
216  av_log(avctx, AV_LOG_ERROR, " Additional information: %s\n",
217  detail);
218  return AVERROR_INVALIDDATA;
219  }
220 
221  if ((img = aom_codec_get_frame(&ctx->decoder, &iter))) {
222  if (img->d_w > img->w || img->d_h > img->h) {
223  av_log(avctx, AV_LOG_ERROR, "Display dimensions %dx%d exceed storage %dx%d\n",
224  img->d_w, img->d_h, img->w, img->h);
225  return AVERROR_EXTERNAL;
226  }
227 
228  if ((ret = set_pix_fmt(avctx, img)) < 0) {
229  av_log(avctx, AV_LOG_ERROR, "Unsupported output colorspace (%d) / bit_depth (%d)\n",
230  img->fmt, img->bit_depth);
231  return ret;
232  }
233 
234  if ((int)img->d_w != avctx->width || (int)img->d_h != avctx->height) {
235  av_log(avctx, AV_LOG_INFO, "dimension change! %dx%d -> %dx%d\n",
236  avctx->width, avctx->height, img->d_w, img->d_h);
237  ret = ff_set_dimensions(avctx, img->d_w, img->d_h);
238  if (ret < 0)
239  return ret;
240  }
241  if ((ret = ff_get_buffer(avctx, picture, 0)) < 0)
242  return ret;
243 
244 #ifdef AOM_CTRL_AOMD_GET_FRAME_FLAGS
245  {
246  aom_codec_frame_flags_t flags;
247  ret = aom_codec_control(&ctx->decoder, AOMD_GET_FRAME_FLAGS, &flags);
248  if (ret == AOM_CODEC_OK) {
249  if (flags & AOM_FRAME_IS_KEY)
250  picture->flags |= AV_FRAME_FLAG_KEY;
251  else
252  picture->flags &= ~AV_FRAME_FLAG_KEY;
253  if (flags & (AOM_FRAME_IS_KEY | AOM_FRAME_IS_INTRAONLY))
254  picture->pict_type = AV_PICTURE_TYPE_I;
255  else if (flags & AOM_FRAME_IS_SWITCH)
256  picture->pict_type = AV_PICTURE_TYPE_SP;
257  else
258  picture->pict_type = AV_PICTURE_TYPE_P;
259  }
260  }
261 #endif
262 
264  &picture->sample_aspect_ratio.den,
265  picture->height * img->r_w,
266  picture->width * img->r_h,
267  INT_MAX);
268  ff_set_sar(avctx, picture->sample_aspect_ratio);
269 
270  if ((img->fmt & AOM_IMG_FMT_HIGHBITDEPTH) && img->bit_depth == 8)
271  ff_aom_image_copy_16_to_8(picture, img);
272  else {
273  const uint8_t *planes[4] = { img->planes[0], img->planes[1], img->planes[2] };
274  const int stride[4] = { img->stride[0], img->stride[1], img->stride[2] };
275 
276  av_image_copy(picture->data, picture->linesize, planes,
277  stride, avctx->pix_fmt, img->d_w, img->d_h);
278  }
279  ret = decode_metadata(picture, img);
280  if (ret < 0) {
281  av_log(avctx, AV_LOG_ERROR, "Failed to decode metadata\n");
282  return ret;
283  }
284  *got_frame = 1;
285  }
286  return avpkt->size;
287 }
288 
289 static av_cold int aom_free(AVCodecContext *avctx)
290 {
291  AV1DecodeContext *ctx = avctx->priv_data;
292  aom_codec_destroy(&ctx->decoder);
293  return 0;
294 }
295 
296 static av_cold int av1_init(AVCodecContext *avctx)
297 {
298  return aom_init(avctx, aom_codec_av1_dx());
299 }
300 
302  .p.name = "libaom-av1",
303  CODEC_LONG_NAME("libaom AV1"),
304  .p.type = AVMEDIA_TYPE_VIDEO,
305  .p.id = AV_CODEC_ID_AV1,
306  .priv_data_size = sizeof(AV1DecodeContext),
307  .init = av1_init,
308  .close = aom_free,
310  .p.capabilities = AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1,
311  .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE |
313  .p.profiles = NULL_IF_CONFIG_SMALL(ff_av1_profiles),
314  .p.wrapper_name = "libaom",
315 };
error
static void error(const char *err)
Definition: target_bsf_fuzzer.c:32
flags
const SwsFlags flags[]
Definition: swscale.c:61
aom_free
static av_cold int aom_free(AVCodecContext *avctx)
Definition: libaomdec.c:289
aom_init
static av_cold int aom_init(AVCodecContext *avctx, const struct aom_codec_iface *iface)
Definition: libaomdec.c:46
AVERROR
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
bytestream2_get_bytes_left
static av_always_inline int bytestream2_get_bytes_left(const GetByteContext *g)
Definition: bytestream.h:158
AVCodecContext::colorspace
enum AVColorSpace colorspace
YUV colorspace type.
Definition: avcodec.h:667
AVColorTransferCharacteristic
AVColorTransferCharacteristic
Color Transfer Characteristic.
Definition: pixfmt.h:666
GetByteContext
Definition: bytestream.h:33
AVFrame
This structure describes decoded (raw) audio or video data.
Definition: frame.h:427
AVCodecContext::color_trc
enum AVColorTransferCharacteristic color_trc
Color Transfer Characteristic.
Definition: avcodec.h:660
AVFrame::width
int width
Definition: frame.h:499
AVCOL_RANGE_JPEG
@ AVCOL_RANGE_JPEG
Full range content.
Definition: pixfmt.h:777
AVPacket::data
uint8_t * data
Definition: packet.h:588
set_pix_fmt
static int set_pix_fmt(AVCodecContext *avctx, struct aom_image *img)
Definition: libaomdec.c:68
AV_PIX_FMT_YUV420P10
#define AV_PIX_FMT_YUV420P10
Definition: pixfmt.h:539
FF_CODEC_CAP_NOT_INIT_THREADSAFE
#define FF_CODEC_CAP_NOT_INIT_THREADSAFE
The codec is not known to be init-threadsafe (i.e.
Definition: codec_internal.h:34
FFCodec
Definition: codec_internal.h:127
AV_LOG_VERBOSE
#define AV_LOG_VERBOSE
Detailed information.
Definition: log.h:226
AVCOL_SPC_RGB
@ AVCOL_SPC_RGB
order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB), YZX and ST 428-1
Definition: pixfmt.h:701
AVFrame::flags
int flags
Frame flags, a combination of AV_FRAME_FLAGS.
Definition: frame.h:671
AVColorPrimaries
AVColorPrimaries
Chromaticity coordinates of the source primaries.
Definition: pixfmt.h:636
AV_PROFILE_AV1_PROFESSIONAL
#define AV_PROFILE_AV1_PROFESSIONAL
Definition: defs.h:171
ff_set_dimensions
int ff_set_dimensions(AVCodecContext *s, int width, int height)
Check that the provided frame dimensions are valid and set them on the codec context.
Definition: utils.c:91
AVFrame::data
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition: frame.h:448
close
static av_cold void close(AVCodecParserContext *s)
Definition: apv_parser.c:197
FFCodec::p
AVCodec p
The public AVCodec.
Definition: codec_internal.h:131
AVCodecContext::thread_count
int thread_count
thread count is used to decide how many independent tasks should be passed to execute()
Definition: avcodec.h:1569
AV_PIX_FMT_GBRP10
#define AV_PIX_FMT_GBRP10
Definition: pixfmt.h:558
av_reduce
int av_reduce(int *dst_num, int *dst_den, int64_t num, int64_t den, int64_t max)
Reduce a fraction.
Definition: rational.c:35
AVRational::num
int num
Numerator.
Definition: rational.h:59
AV_PIX_FMT_YUV444P10
#define AV_PIX_FMT_YUV444P10
Definition: pixfmt.h:542
AV1DecodeContext::decoder
struct aom_codec_ctx decoder
Definition: libaomdec.c:43
AVCodecContext::color_primaries
enum AVColorPrimaries color_primaries
Chromaticity coordinates of the source primaries.
Definition: avcodec.h:653
AV_LOG_ERROR
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition: log.h:210
av_cold
#define av_cold
Definition: attributes.h:106
AV_FRAME_FLAG_KEY
#define AV_FRAME_FLAG_KEY
A flag to mark frames that are keyframes.
Definition: frame.h:642
FF_CODEC_DECODE_CB
#define FF_CODEC_DECODE_CB(func)
Definition: codec_internal.h:347
AV_CODEC_CAP_OTHER_THREADS
#define AV_CODEC_CAP_OTHER_THREADS
Codec supports multithreading through a method other than slice- or frame-level multithreading.
Definition: codec.h:109
GetByteContext::buffer
const uint8_t * buffer
Definition: bytestream.h:34
ctx
AVFormatContext * ctx
Definition: movenc.c:49
decode.h
ff_av1_profiles
const AVProfile ff_av1_profiles[]
Definition: profiles.c:163
AV_PIX_FMT_YUV420P
@ AV_PIX_FMT_YUV420P
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
Definition: pixfmt.h:73
CODEC_LONG_NAME
#define CODEC_LONG_NAME(str)
Definition: codec_internal.h:332
AV_PIX_FMT_GRAY10
#define AV_PIX_FMT_GRAY10
Definition: pixfmt.h:519
if
if(ret)
Definition: filter_design.txt:179
metadata
Stream codec metadata
Definition: ogg-flac-chained-meta.txt:2
NULL
#define NULL
Definition: coverity.c:32
AVCodecContext::color_range
enum AVColorRange color_range
MPEG vs JPEG YUV range.
Definition: avcodec.h:677
AV_CODEC_ID_AV1
@ AV_CODEC_ID_AV1
Definition: codec_id.h:284
ff_libaom_av1_decoder
const FFCodec ff_libaom_av1_decoder
Definition: libaomdec.c:301
AV_PICTURE_TYPE_I
@ AV_PICTURE_TYPE_I
Intra.
Definition: avutil.h:278
profiles.h
ff_set_sar
int ff_set_sar(AVCodecContext *avctx, AVRational sar)
Check that the provided sample aspect ratio is valid and set it on the codec context.
Definition: utils.c:106
planes
static const struct @548 planes[]
AV_PIX_FMT_YUV422P10
#define AV_PIX_FMT_YUV422P10
Definition: pixfmt.h:540
AV_PIX_FMT_GRAY8
@ AV_PIX_FMT_GRAY8
Y , 8bpp.
Definition: pixfmt.h:81
AV_PICTURE_TYPE_SP
@ AV_PICTURE_TYPE_SP
Switching Predicted.
Definition: avutil.h:283
av_cpu_count
int av_cpu_count(void)
Definition: cpu.c:222
AVFrame::pict_type
enum AVPictureType pict_type
Picture type of the frame.
Definition: frame.h:519
ff_get_buffer
int ff_get_buffer(AVCodecContext *avctx, AVFrame *frame, int flags)
Get a buffer for a frame.
Definition: decode.c:1729
init
int(* init)(AVBSFContext *ctx)
Definition: dts2pts.c:550
AV_CODEC_CAP_DR1
#define AV_CODEC_CAP_DR1
Codec uses get_buffer() or get_encode_buffer() for allocating buffers and supports custom allocators.
Definition: codec.h:52
AVPacket::size
int size
Definition: packet.h:589
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
av1_init
static av_cold int av1_init(AVCodecContext *avctx)
Definition: libaomdec.c:296
codec_internal.h
cpu.h
AV_PIX_FMT_YUV422P12
#define AV_PIX_FMT_YUV422P12
Definition: pixfmt.h:544
AV_PIX_FMT_YUV444P12
#define AV_PIX_FMT_YUV444P12
Definition: pixfmt.h:546
aom_decode
static int aom_decode(AVCodecContext *avctx, AVFrame *picture, int *got_frame, AVPacket *avpkt)
Definition: libaomdec.c:201
img
#define img
Definition: vf_colormatrix.c:114
AVERROR_EXTERNAL
#define AVERROR_EXTERNAL
Generic error in an external library.
Definition: error.h:59
AV_PROFILE_AV1_HIGH
#define AV_PROFILE_AV1_HIGH
Definition: defs.h:170
AV_LOG_INFO
#define AV_LOG_INFO
Standard information.
Definition: log.h:221
i
#define i(width, name, range_min, range_max)
Definition: cbs_h2645.c:256
AV_PIX_FMT_GBRP12
#define AV_PIX_FMT_GBRP12
Definition: pixfmt.h:559
AVColorSpace
AVColorSpace
YUV colorspace type.
Definition: pixfmt.h:700
common.h
FFMIN
#define FFMIN(a, b)
Definition: macros.h:49
AVCodec::name
const char * name
Name of the codec implementation.
Definition: codec.h:179
AVCodecContext::height
int height
Definition: avcodec.h:600
AVCodecContext::pix_fmt
enum AVPixelFormat pix_fmt
Pixel format, see AV_PIX_FMT_xxx.
Definition: avcodec.h:639
AVCOL_RANGE_MPEG
@ AVCOL_RANGE_MPEG
Narrow or limited range content.
Definition: pixfmt.h:760
AVDynamicHDRPlus
This struct represents dynamic metadata for color volume transform - application 4 of SMPTE 2094-40:2...
Definition: hdr_dynamic_metadata.h:243
avcodec.h
av_dynamic_hdr_plus_create_side_data
AVDynamicHDRPlus * av_dynamic_hdr_plus_create_side_data(AVFrame *frame)
Allocate a complete AVDynamicHDRPlus and add it to the frame.
Definition: hdr_dynamic_metadata.c:48
ret
ret
Definition: filter_design.txt:187
frame
these buffered frames must be flushed immediately if a new input produces new the filter must not call request_frame to get more It must just process the frame or queue it The task of requesting more frames is left to the filter s request_frame method or the application If a filter has several the filter must be ready for frames arriving randomly on any input any filter with several inputs will most likely require some kind of queuing mechanism It is perfectly acceptable to have a limited queue and to drop frames when the inputs are too unbalanced request_frame For filters that do not use the this method is called when a frame is wanted on an output For a it should directly call filter_frame on the corresponding output For a if there are queued frames already one of these frames should be pushed If the filter should request a frame on one of its repeatedly until at least one frame has been pushed Return or at least make progress towards producing a frame
Definition: filter_design.txt:265
AVFrame::sample_aspect_ratio
AVRational sample_aspect_ratio
Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
Definition: frame.h:524
AV_PIX_FMT_YUV420P12
#define AV_PIX_FMT_YUV420P12
Definition: pixfmt.h:543
AVCodecContext
main external API structure.
Definition: avcodec.h:439
AVFrame::height
int height
Definition: frame.h:499
itut35.h
buffer
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
Definition: filter_design.txt:49
AVRational::den
int den
Denominator.
Definition: rational.h:60
AVCodecContext::profile
int profile
profile
Definition: avcodec.h:1626
AV1DecodeContext
Definition: libaomdec.c:42
hdr_dynamic_metadata.h
AV_PIX_FMT_YUV444P
@ AV_PIX_FMT_YUV444P
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
Definition: pixfmt.h:78
AV_PIX_FMT_GBRP
@ AV_PIX_FMT_GBRP
planar GBR 4:4:4 24bpp
Definition: pixfmt.h:165
AV_PICTURE_TYPE_P
@ AV_PICTURE_TYPE_P
Predicted.
Definition: avutil.h:279
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:200
AV_PIX_FMT_YUV422P
@ AV_PIX_FMT_YUV422P
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
Definition: pixfmt.h:77
FF_CODEC_CAP_AUTO_THREADS
#define FF_CODEC_CAP_AUTO_THREADS
Codec handles avctx->thread_count == 0 (auto) internally.
Definition: codec_internal.h:72
ITU_T_T35_COUNTRY_CODE_US
#define ITU_T_T35_COUNTRY_CODE_US
Definition: itut35.h:24
ff_aom_image_copy_16_to_8
void ff_aom_image_copy_16_to_8(AVFrame *pic, struct aom_image *img)
Definition: libaom.c:27
AVPacket
This structure stores compressed data.
Definition: packet.h:565
AVCodecContext::priv_data
void * priv_data
Definition: avcodec.h:466
decode_metadata_itu_t_t35
static int decode_metadata_itu_t_t35(AVFrame *frame, const uint8_t *buffer, size_t buffer_size)
Definition: libaomdec.c:146
av_dynamic_hdr_plus_from_t35
int av_dynamic_hdr_plus_from_t35(AVDynamicHDRPlus *s, const uint8_t *data, size_t size)
Parse the user data registered ITU-T T.35 to AVbuffer (AVDynamicHDRPlus).
Definition: hdr_dynamic_metadata.c:61
AVCodecContext::width
int width
picture width / height.
Definition: avcodec.h:600
bytestream.h
imgutils.h
bytestream2_init
static av_always_inline void bytestream2_init(GetByteContext *g, const uint8_t *buf, int buf_size)
Definition: bytestream.h:137
AVFrame::linesize
int linesize[AV_NUM_DATA_POINTERS]
For video, a positive or negative value, which is typically indicating the size in bytes of each pict...
Definition: frame.h:472
av_log
#define av_log(a,...)
Definition: tableprint_vlc.h:27
ITU_T_T35_PROVIDER_CODE_SAMSUNG
#define ITU_T_T35_PROVIDER_CODE_SAMSUNG
Definition: itut35.h:41
AVERROR_INVALIDDATA
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
Definition: error.h:61
stride
#define stride
Definition: h264pred_template.c:536
AV_PIX_FMT_GRAY12
#define AV_PIX_FMT_GRAY12
Definition: pixfmt.h:520
av_image_copy
void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], const uint8_t *const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height)
Copy image in src_data to dst_data.
Definition: imgutils.c:422
libaom.h
AV_PROFILE_AV1_MAIN
#define AV_PROFILE_AV1_MAIN
Definition: defs.h:169
AVColorRange
AVColorRange
Visual content value range.
Definition: pixfmt.h:742
decode_metadata
static int decode_metadata(AVFrame *frame, const struct aom_image *img)
Definition: libaomdec.c:179