36 #if CONFIG_DIRAC_PARSE 38 typedef struct dirac_source_params {
50 uint16_t clean_height;
51 uint16_t clean_left_offset;
52 uint16_t clean_right_offset;
56 } dirac_source_params;
59 static const dirac_source_params dirac_source_parameters_defaults[] = {
60 { 640, 480, 2, 0, 0, 1, 1, 640, 480, 0, 0, 1, 0 },
61 { 176, 120, 2, 0, 0, 9, 2, 176, 120, 0, 0, 1, 1 },
62 { 176, 144, 2, 0, 1, 10, 3, 176, 144, 0, 0, 1, 2 },
63 { 352, 240, 2, 0, 0, 9, 2, 352, 240, 0, 0, 1, 1 },
64 { 352, 288, 2, 0, 1, 10, 3, 352, 288, 0, 0, 1, 2 },
65 { 704, 480, 2, 0, 0, 9, 2, 704, 480, 0, 0, 1, 1 },
66 { 704, 576, 2, 0, 1, 10, 3, 704, 576, 0, 0, 1, 2 },
67 { 720, 480, 1, 1, 0, 4, 2, 704, 480, 8, 0, 3, 1 },
68 { 720, 576, 1, 1, 1, 3, 3, 704, 576, 8, 0, 3, 2 },
70 { 1280, 720, 1, 0, 1, 7, 1, 1280, 720, 0, 0, 3, 3 },
71 { 1280, 720, 1, 0, 1, 6, 1, 1280, 720, 0, 0, 3, 3 },
72 { 1920, 1080, 1, 1, 1, 4, 1, 1920, 1080, 0, 0, 3, 3 },
73 { 1920, 1080, 1, 1, 1, 3, 1, 1920, 1080, 0, 0, 3, 3 },
74 { 1920, 1080, 1, 0, 1, 7, 1, 1920, 1080, 0, 0, 3, 3 },
75 { 1920, 1080, 1, 0, 1, 6, 1, 1920, 1080, 0, 0, 3, 3 },
76 { 2048, 1080, 0, 0, 1, 2, 1, 2048, 1080, 0, 0, 4, 4 },
77 { 4096, 2160, 0, 0, 1, 2, 1, 4096, 2160, 0, 0, 4, 4 },
79 { 3840, 2160, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
80 { 3840, 2160, 1, 0, 1, 6, 1, 3840, 2160, 0, 0, 3, 3 },
81 { 7680, 4320, 1, 0, 1, 7, 1, 3840, 2160, 0, 0, 3, 3 },
82 { 7680, 4320, 1, 0, 1, 6, 1, 3840, 2160, 0, 0, 3, 3 },
86 static const AVRational dirac_preset_aspect_ratios[] = {
105 static const struct {
108 } pixel_range_presets[] = {
121 static const struct {
125 } dirac_color_presets[] = {
145 unsigned luma_depth = 8, luma_offset = 16;
256 luma_depth = pixel_range_presets[idx].bitdepth;
257 dsh->
color_range = pixel_range_presets[idx].color_range;
260 if (luma_depth > 8 && log_ctx)
274 dsh->
colorspace = dirac_color_presets[idx].colorspace;
275 dsh->
color_trc = dirac_color_presets[idx].color_trc;
299 dsh->
colorspace = dirac_color_presets[idx].colorspace;
300 dsh->
color_trc = dirac_color_presets[idx].color_trc;
308 const uint8_t *buf,
size_t buf_size,
313 unsigned version_major;
314 unsigned video_format, picture_coding_mode;
335 if (version_major < 2)
337 else if (version_major > 2)
341 if (video_format > 20) {
347 dsh->
width = dirac_source_parameters_defaults[video_format].width;
348 dsh->
height = dirac_source_parameters_defaults[video_format].height;
349 dsh->
chroma_format = dirac_source_parameters_defaults[video_format].chroma_format;
350 dsh->
interlaced = dirac_source_parameters_defaults[video_format].interlaced;
351 dsh->
top_field_first = dirac_source_parameters_defaults[video_format].top_field_first;
352 dsh->
frame_rate_index = dirac_source_parameters_defaults[video_format].frame_rate_index;
353 dsh->
aspect_ratio_index = dirac_source_parameters_defaults[video_format].aspect_ratio_index;
354 dsh->
clean_width = dirac_source_parameters_defaults[video_format].clean_width;
355 dsh->
clean_height = dirac_source_parameters_defaults[video_format].clean_height;
356 dsh->
clean_left_offset = dirac_source_parameters_defaults[video_format].clean_left_offset;
357 dsh->
clean_right_offset = dirac_source_parameters_defaults[video_format].clean_right_offset;
358 dsh->
pixel_range_index = dirac_source_parameters_defaults[video_format].pixel_range_index;
359 dsh->
color_spec_index = dirac_source_parameters_defaults[video_format].color_spec_index;
363 ret = parse_source_parameters(dsh, &gb, log_ctx);
370 if (picture_coding_mode != 0) {
373 picture_coding_mode);
388 const uint8_t *buf,
size_t buf_size,
also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
#define AV_LOG_WARNING
Something somehow does not look correct.
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601 ...
av_log(ac->avr, AV_LOG_TRACE, "%d samples - audio_convert: %s to %s (%s)\, len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt), use_generic ? ac->func_descr_generic :ac->func_descr)
AVColorTransferCharacteristic
Color Transfer Characteristic.
int av_dirac_parse_sequence_header(AVDiracSeqHeader **pdsh, const uint8_t *buf, size_t buf_size, void *log_ctx)
Parse a Dirac sequence header.
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
Interface to Dirac Decoder/Encoder.
AVColorSpace
YUV colorspace type.
planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV422P and setting col...
AVColorRange
MPEG vs JPEG YUV range.
AVColorPrimaries
Chromaticity coordinates of the source primaries.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV420P and setting col...
also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
the normal 2^n-1 "JPEG" YUV ranges
Libavcodec external API header.
static int init_get_bits8(GetBitContext *s, const uint8_t *buffer, int byte_size)
Initialize GetBitContext.
static unsigned int get_bits1(GetBitContext *s)
rational number numerator/denominator
the normal 219*2^(n-8) "MPEG" YUV ranges
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal api header.
planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of AV_PIX_FMT_YUV444P and setting col...
also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
static unsigned get_interleaved_ue_golomb(GetBitContext *gb)
AVPixelFormat
Pixel format.
void * av_mallocz(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
const AVRational ff_mpeg12_frame_rate_tab[]