34 static const uint8_t dv_audio_shuffle525[10][9] = {
35 { 0, 30, 60, 20, 50, 80, 10, 40, 70 },
36 { 6, 36, 66, 26, 56, 86, 16, 46, 76 },
37 { 12, 42, 72, 2, 32, 62, 22, 52, 82 },
38 { 18, 48, 78, 8, 38, 68, 28, 58, 88 },
39 { 24, 54, 84, 14, 44, 74, 4, 34, 64 },
41 { 1, 31, 61, 21, 51, 81, 11, 41, 71 },
42 { 7, 37, 67, 27, 57, 87, 17, 47, 77 },
43 { 13, 43, 73, 3, 33, 63, 23, 53, 83 },
44 { 19, 49, 79, 9, 39, 69, 29, 59, 89 },
45 { 25, 55, 85, 15, 45, 75, 5, 35, 65 },
48 static const uint8_t dv_audio_shuffle625[12][9] = {
49 { 0, 36, 72, 26, 62, 98, 16, 52, 88 },
50 { 6, 42, 78, 32, 68, 104, 22, 58, 94 },
51 { 12, 48, 84, 2, 38, 74, 28, 64, 100 },
52 { 18, 54, 90, 8, 44, 80, 34, 70, 106 },
53 { 24, 60, 96, 14, 50, 86, 4, 40, 76 },
54 { 30, 66, 102, 20, 56, 92, 10, 46, 82 },
56 { 1, 37, 73, 27, 63, 99, 17, 53, 89 },
57 { 7, 43, 79, 33, 69, 105, 23, 59, 95 },
58 { 13, 49, 85, 3, 39, 75, 29, 65, 101 },
59 { 19, 55, 91, 9, 45, 81, 35, 71, 107 },
60 { 25, 61, 97, 15, 51, 87, 5, 41, 77 },
61 { 31, 67, 103, 21, 57, 93, 11, 47, 83 },
65 static const uint8_t block_sizes_dv2550[8] = {
66 112, 112, 112, 112, 80, 80, 0, 0,
69 static const uint8_t block_sizes_dv100[8] = {
70 80, 80, 80, 80, 80, 80, 64, 64,
79 .time_base = { 1001, 30000 },
83 .sar = { { 8, 9 }, { 32, 27 } },
86 .block_sizes = block_sizes_dv2550,
88 .audio_min_samples = { 1580, 1452, 1053 },
89 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 },
90 .audio_shuffle = dv_audio_shuffle525, },
96 .time_base = { 1, 25 },
100 .sar = { { 16, 15 }, { 64, 45 } },
103 .block_sizes = block_sizes_dv2550,
105 .audio_min_samples = { 1896, 1742, 1264 },
106 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
107 .audio_shuffle = dv_audio_shuffle625, },
110 .frame_size = 144000,
113 .time_base = { 1, 25 },
117 .sar = { { 16, 15 }, { 64, 45 } },
120 .block_sizes = block_sizes_dv2550,
122 .audio_min_samples = { 1896, 1742, 1264 },
123 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
124 .audio_shuffle = dv_audio_shuffle625, },
127 .frame_size = 240000,
130 .time_base = { 1001, 30000 },
134 .sar = { { 8, 9 }, { 32, 27 } },
137 .block_sizes = block_sizes_dv2550,
139 .audio_min_samples = { 1580, 1452, 1053 },
140 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 },
141 .audio_shuffle = dv_audio_shuffle525, },
144 .frame_size = 288000,
147 .time_base = { 1, 25 },
151 .sar = { { 16, 15 }, { 64, 45 } },
154 .block_sizes = block_sizes_dv2550,
156 .audio_min_samples = { 1896, 1742, 1264 },
157 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
158 .audio_shuffle = dv_audio_shuffle625, },
161 .frame_size = 480000,
164 .time_base = { 1001, 30000 },
168 .sar = { { 1, 1 }, { 3, 2 } },
171 .block_sizes = block_sizes_dv100,
173 .audio_min_samples = { 1580, 1452, 1053 },
174 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 },
175 .audio_shuffle = dv_audio_shuffle525, },
178 .frame_size = 576000,
181 .time_base = { 1, 25 },
185 .sar = { { 1, 1 }, { 4, 3 } },
188 .block_sizes = block_sizes_dv100,
190 .audio_min_samples = { 1896, 1742, 1264 },
191 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
192 .audio_shuffle = dv_audio_shuffle625, },
195 .frame_size = 240000,
198 .time_base = { 1001, 60000 },
202 .sar = { { 1, 1 }, { 4, 3 } },
205 .block_sizes = block_sizes_dv100,
207 .audio_min_samples = { 1580, 1452, 1053 },
208 .audio_samples_dist = { 1600, 1602, 1602, 1602, 1602 },
209 .audio_shuffle = dv_audio_shuffle525, },
212 .frame_size = 288000,
215 .time_base = { 1, 50 },
219 .sar = { { 1, 1 }, { 4, 3 } },
222 .block_sizes = block_sizes_dv100,
224 .audio_min_samples = { 1896, 1742, 1264 },
225 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
226 .audio_shuffle = dv_audio_shuffle625, },
229 .frame_size = 144000,
232 .time_base = { 1, 25 },
236 .sar = { { 16, 15 }, { 64, 45 } },
239 .block_sizes = block_sizes_dv2550,
241 .audio_min_samples = { 1896, 1742, 1264 },
242 .audio_samples_dist = { 1920, 1920, 1920, 1920, 1920 },
243 .audio_shuffle = dv_audio_shuffle625, }
252 "Frame size: %dx%d; pixel format: %s, framerate: %d/%d\n",
269 dsf = (frame[3] & 0x80) >> 7;
270 stype = frame[80 * 5 + 48 + 3] & 0x1f;
273 if ((dsf == 1 && stype == 0 && frame[4] & 0x07 ) ||
275 return &dv_profiles[2];
282 return &dv_profiles[1];
285 if (dsf == dv_profiles[i].dsf && stype == dv_profiles[i].video_stype)
286 return &dv_profiles[
i];
293 if ((frame[3] & 0x7f) == 0x3f && frame[80 * 5 + 48 + 3] == 0xff)
294 return &dv_profiles[dsf];
324 int invalid_framerate = frame_rate.
num == 0 || frame_rate.
den == 0;
327 if (height == dv_profiles[i].height &&
328 pix_fmt == dv_profiles[i].pix_fmt &&
329 width == dv_profiles[i].width)
331 if( invalid_framerate ||
av_div_q(dv_profiles[i].time_base, frame_rate).
num == 1 )
332 return &dv_profiles[i];
static enum AVPixelFormat pix_fmt
AVRational av_div_q(AVRational b, AVRational c)
Divide one rational by another.
int coded_width
Bitstream width / height, may be different from width/height e.g.
void ff_dv_print_profiles(void *logctx, int loglevel)
Print all allowed DV profiles into logctx at specified logging level.
const AVDVProfile * ff_dv_frame_profile(AVCodecContext *codec, const AVDVProfile *sys, const uint8_t *frame, unsigned buf_size)
Get a DV profile for the provided compressed frame.
enum AVPixelFormat pix_fmt
const AVDVProfile * av_dv_frame_profile(const AVDVProfile *sys, const uint8_t *frame, unsigned buf_size)
Get a DV profile for the provided compressed frame.
planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
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
const AVDVProfile * av_dv_codec_profile(int width, int height, enum AVPixelFormat pix_fmt)
Get a DV profile for the provided stream parameters.
#define FF_ARRAY_ELEMS(a)
Libavcodec external API header.
main external API structure.
unsigned int codec_tag
fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
Rational number (pair of numerator and denominator).
planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
common internal and external API header
planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
const AVDVProfile * av_dv_codec_profile2(int width, int height, enum AVPixelFormat pix_fmt, AVRational frame_rate)
Get a DV profile for the provided stream parameters.
const char * av_get_pix_fmt_name(enum AVPixelFormat pix_fmt)
Return the short name for a pixel format, NULL in case pix_fmt is unknown.
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
AVPixelFormat
Pixel format.