23 #define UNCHECKED_BITSTREAM_READER 1
41 #define SPRITE_TRAJ_VLC_BITS 6
43 #define MB_TYPE_B_VLC_BITS 4
64 int16_t *ac_val, *ac_val1;
76 if (s->
mb_x == 0 || s->
qscale == qscale_table[xy] ||
79 for (i = 1; i < 8; i++)
83 for (i = 1; i < 8; i++)
91 if (s->
mb_y == 0 || s->
qscale == qscale_table[xy] ||
94 for (i = 1; i < 8; i++)
98 for (i = 1; i < 8; i++)
104 for (i = 1; i < 8; i++)
108 for (i = 1; i < 8; i++)
136 v |= 0x7F >> (7 - (bits_count & 7));
149 for (len = 0; len < 32; len++)
176 int min_ab, i, w2, h2, w3, h3;
177 int sprite_ref[4][2];
178 int virtual_ref[2][2];
181 const int vop_ref[4][2] = { { 0, 0 }, { s->
width, 0 },
183 int d[4][2] = { { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 } };
185 if (w <= 0 || h <= 0)
210 while ((1 << alpha) < w)
212 while ((1 << beta) < h)
219 sprite_ref[0][0] = a * vop_ref[0][0] + d[0][0];
220 sprite_ref[0][1] = a * vop_ref[0][1] + d[0][1];
221 sprite_ref[1][0] = a * vop_ref[1][0] + d[0][0] + d[1][0];
222 sprite_ref[1][1] = a * vop_ref[1][1] + d[0][1] + d[1][1];
223 sprite_ref[2][0] = a * vop_ref[2][0] + d[0][0] + d[2][0];
224 sprite_ref[2][1] = a * vop_ref[2][1] + d[0][1] + d[2][1];
226 sprite_ref[0][0] = (a >> 1) * (2 * vop_ref[0][0] + d[0][0]);
227 sprite_ref[0][1] = (a >> 1) * (2 * vop_ref[0][1] + d[0][1]);
228 sprite_ref[1][0] = (a >> 1) * (2 * vop_ref[1][0] + d[0][0] + d[1][0]);
229 sprite_ref[1][1] = (a >> 1) * (2 * vop_ref[1][1] + d[0][1] + d[1][1]);
230 sprite_ref[2][0] = (a >> 1) * (2 * vop_ref[2][0] + d[0][0] + d[2][0]);
231 sprite_ref[2][1] = (a >> 1) * (2 * vop_ref[2][1] + d[0][1] + d[2][1]);
241 virtual_ref[0][0] = 16 * (vop_ref[0][0] + w2) +
243 (r * sprite_ref[0][0] - 16 * vop_ref[0][0]) +
244 w2 * (r * sprite_ref[1][0] - 16 * vop_ref[1][0])), w);
245 virtual_ref[0][1] = 16 * vop_ref[0][1] +
247 (r * sprite_ref[0][1] - 16 * vop_ref[0][1]) +
248 w2 * (r * sprite_ref[1][1] - 16 * vop_ref[1][1])), w);
249 virtual_ref[1][0] = 16 * vop_ref[0][0] +
250 ROUNDED_DIV(((h - h2) * (r * sprite_ref[0][0] - 16 * vop_ref[0][0]) +
251 h2 * (r * sprite_ref[2][0] - 16 * vop_ref[2][0])), h);
252 virtual_ref[1][1] = 16 * (vop_ref[0][1] + h2) +
253 ROUNDED_DIV(((h - h2) * (r * sprite_ref[0][1] - 16 * vop_ref[0][1]) +
254 h2 * (r * sprite_ref[2][1] - 16 * vop_ref[2][1])),
h);
270 s->
sprite_offset[0][0] = sprite_ref[0][0] - a * vop_ref[0][0];
271 s->
sprite_offset[0][1] = sprite_ref[0][1] - a * vop_ref[0][1];
272 s->
sprite_offset[1][0] = ((sprite_ref[0][0] >> 1) | (sprite_ref[0][0] & 1)) -
273 a * (vop_ref[0][0] / 2);
274 s->
sprite_offset[1][1] = ((sprite_ref[0][1] >> 1) | (sprite_ref[0][1] & 1)) -
275 a * (vop_ref[0][1] / 2);
284 s->
sprite_offset[0][0] = (sprite_ref[0][0] << (alpha + rho)) +
285 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
287 (r * sprite_ref[0][1] - virtual_ref[0][1]) *
288 (-vop_ref[0][1]) + (1 << (alpha + rho - 1));
289 s->
sprite_offset[0][1] = (sprite_ref[0][1] << (alpha + rho)) +
290 (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
292 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
293 (-vop_ref[0][1]) + (1 << (alpha + rho - 1));
294 s->
sprite_offset[1][0] = ((-r * sprite_ref[0][0] + virtual_ref[0][0]) *
295 (-2 * vop_ref[0][0] + 1) +
296 (r * sprite_ref[0][1] - virtual_ref[0][1]) *
297 (-2 * vop_ref[0][1] + 1) + 2 * w2 * r *
298 sprite_ref[0][0] - 16 * w2 + (1 << (alpha + rho + 1)));
299 s->
sprite_offset[1][1] = ((-r * sprite_ref[0][1] + virtual_ref[0][1]) *
300 (-2 * vop_ref[0][0] + 1) +
301 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
302 (-2 * vop_ref[0][1] + 1) + 2 * w2 * r *
303 sprite_ref[0][1] - 16 * w2 + (1 << (alpha + rho + 1)));
304 s->
sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
305 s->
sprite_delta[0][1] = (+r * sprite_ref[0][1] - virtual_ref[0][1]);
306 s->
sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]);
307 s->
sprite_delta[1][1] = (-r * sprite_ref[0][0] + virtual_ref[0][0]);
313 min_ab =
FFMIN(alpha, beta);
316 s->
sprite_offset[0][0] = (sprite_ref[0][0] << (alpha + beta + rho - min_ab)) +
317 (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
318 h3 * (-vop_ref[0][0]) +
319 (-r * sprite_ref[0][0] + virtual_ref[1][0]) *
320 w3 * (-vop_ref[0][1]) +
321 (1 << (alpha + beta + rho - min_ab - 1));
322 s->
sprite_offset[0][1] = (sprite_ref[0][1] << (alpha + beta + rho - min_ab)) +
323 (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
324 h3 * (-vop_ref[0][0]) +
325 (-r * sprite_ref[0][1] + virtual_ref[1][1]) *
326 w3 * (-vop_ref[0][1]) +
327 (1 << (alpha + beta + rho - min_ab - 1));
328 s->
sprite_offset[1][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]) *
329 h3 * (-2 * vop_ref[0][0] + 1) +
330 (-r * sprite_ref[0][0] + virtual_ref[1][0]) *
331 w3 * (-2 * vop_ref[0][1] + 1) + 2 * w2 * h3 *
332 r * sprite_ref[0][0] - 16 * w2 * h3 +
333 (1 << (alpha + beta + rho - min_ab + 1));
334 s->
sprite_offset[1][1] = (-r * sprite_ref[0][1] + virtual_ref[0][1]) *
335 h3 * (-2 * vop_ref[0][0] + 1) +
336 (-r * sprite_ref[0][1] + virtual_ref[1][1]) *
337 w3 * (-2 * vop_ref[0][1] + 1) + 2 * w2 * h3 *
338 r * sprite_ref[0][1] - 16 * w2 * h3 +
339 (1 << (alpha + beta + rho - min_ab + 1));
340 s->
sprite_delta[0][0] = (-r * sprite_ref[0][0] + virtual_ref[0][0]) * h3;
341 s->
sprite_delta[0][1] = (-r * sprite_ref[0][0] + virtual_ref[1][0]) * w3;
342 s->
sprite_delta[1][0] = (-r * sprite_ref[0][1] + virtual_ref[0][1]) * h3;
343 s->
sprite_delta[1][1] = (-r * sprite_ref[0][1] + virtual_ref[1][1]) * w3;
368 for (i = 0; i < 2; i++) {
401 int header_extension = 0, mb_num,
len;
407 for (len = 0; len < 32; len++)
422 if (mb_num >= s->
mb_num) {
424 "illegal mb_num in video packet (%d %d) \n", mb_num, s->
mb_num);
440 if (header_extension) {
446 check_marker(&s->
gb,
"before time_increment in video packed header");
448 check_marker(&s->
gb,
"before vop_coding_type in video packed header");
469 "Error, video packet header damaged (f_code=0)\n");
475 "Error, video packet header damaged (b_code=0)\n");
493 int x,
y, mb_v, sum, dx, dy,
shift;
510 dy -= 1 << (shift + a + 1);
512 dx -= 1 << (shift + a + 1);
516 for (y = 0; y < 16; y++) {
521 for (x = 0; x < 16; x++) {
552 if (code < 0 || code > 9 ) {
565 level =
get_bits(&s->
gb, code - 1) + (1 << (code - 1));
567 level = -
get_bits(&s->
gb, code - 1) - (1 << (code - 1));
594 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
620 "mcbpc corrupted at %d %d\n", s->
mb_x, s->
mb_y);
635 for (i = 0; i < 6; i++) {
640 "DC corrupted at %d %d\n", s->
mb_x, s->
mb_y);
649 int mx, my, pred_x, pred_y,
bits;
659 if (bits & 0x10000) {
692 "mcbpc corrupted at %d %d\n", s->
mb_x, s->
mb_y);
724 if ((cbpc & 16) == 0) {
758 for (i = 0; i < 4; i++) {
787 static const int8_t quant_tab[4] = { -1, -2, 1, 2 };
806 "cbpy corrupted at %d %d\n", s->
mb_x, s->
mb_y);
821 "I cbpy corrupted at %d %d\n", s->
mb_x, s->
mb_y);
829 for (i = 0; i < 6; i++) {
834 "DC corrupted at %d %d\n", s->
mb_x, s->
mb_y);
853 "P cbpy corrupted at %d %d\n", s->
mb_x, s->
mb_y);
866 if (mb_num >= mb_count)
905 "marker missing after first I partition at %d %d\n",
914 "marker missing after first P partition at %d %d\n",
941 int n,
int coded,
int intra,
int rvlc)
944 int level, i, last,
run, qmul, qadd;
984 if (dc_pred_dir == 0)
1015 qadd = (s->
qscale - 1) | 1;
1032 "1. marker bit missing in rvlc esc\n");
1045 "2. marker bit missing in rvlc esc\n");
1059 level = level * qmul + qadd;
1071 cache ^= 0xC0000000;
1073 if (cache & 0x80000000) {
1074 if (cache & 0x40000000) {
1089 "1. marker bit missing in 3. esc\n");
1100 "2. marker bit missing in 3. esc\n");
1109 if (s->error_recognition >= FF_ER_COMPLIANT) {
1110 const int abs_level=
FFABS(level);
1112 const int run1= run - rl->
max_run[last][abs_level] - 1;
1113 if (abs_level <= rl->max_level[last][run]) {
1117 if (s->error_recognition > FF_ER_COMPLIANT) {
1118 if (abs_level <= rl->max_level[last][run]*2) {
1122 if (run1 >= 0 && abs_level <= rl->max_level[last][run1]) {
1131 level = level * qmul + qadd;
1133 level = level * qmul - qadd;
1135 if ((
unsigned)(level + 2048) > 4095) {
1137 if (level > 2560 || level < -2560) {
1139 "|level| overflow in 3. esc, qp=%d\n",
1144 level = level < 0 ? -2048 : 2047;
1154 i += run + rl->
max_run[run >> 7][level / qmul] + 1;
1163 level = level + rl->
max_level[run >> 7][(run - 1) & 63] * qmul;
1173 ff_tlog(s->
avctx,
"dct[%d][%d] = %- 4d end?:%d\n", scan_table[i&63]&7, scan_table[i&63] >> 3, level, i>62);
1178 "ac-tex damaged at %d %d\n", s->
mb_x, s->
mb_y);
1182 block[scan_table[i]] =
level;
1186 block[scan_table[i]] =
level;
1228 for (i = 0; i < 4; i++) {
1236 for (i = 0; i < 6; i++)
1269 for (i = 0; i < 6; i++) {
1272 "texture corrupted at %d %d %d\n",
1299 int cbpc, cbpy, i, cbp, pred_x, pred_y, mx, my, dquant;
1301 static int8_t quant_tab[4] = { -1, -2, 1, 2 };
1312 for (i = 0; i < 6; i++)
1340 "mcbpc damaged at %d %d\n", s->
mb_x, s->
mb_y);
1343 }
while (cbpc == 20);
1358 cbp = (cbpc & 3) | (cbpy << 2);
1366 if ((cbpc & 16) == 0) {
1375 s->
mv[0][0][0] = mx;
1376 s->
mv[0][0][1] = my;
1389 for (i = 0; i < 2; i++) {
1398 s->
mv[0][i][0] = mx;
1399 s->
mv[0][i][1] = my;
1415 s->
mv[0][0][0] = mx;
1416 s->
mv[0][0][1] = my;
1421 for (i = 0; i < 4; i++) {
1430 s->
mv[0][i][0] = mx;
1431 s->
mv[0][i][1] = my;
1445 for (i = 0; i < 2; i++) {
1460 for (i = 0; i < 6; i++)
1530 s->
mv[0][0][0] = mx;
1533 s->
mv[0][0][1] = my;
1543 s->
mv[1][0][0] = mx;
1546 s->
mv[1][0][1] = my;
1554 for (i = 0; i < 2; i++) {
1558 s->
mv[0][i][0] = mx;
1559 s->
last_mv[0][i][1] = (s->
mv[0][i][1] = my) * 2;
1566 for (i = 0; i < 2; i++) {
1570 s->
mv[1][i][0] = mx;
1571 s->
last_mv[1][i][1] = (s->
mv[1][i][1] = my) * 2;
1595 "I cbpc damaged at %d %d\n", s->
mb_x, s->
mb_y);
1598 }
while (cbpc == 8);
1613 "I cbpy damaged at %d %d\n", s->
mb_x, s->
mb_y);
1616 cbp = (cbpc & 3) | (cbpy << 2);
1628 for (i = 0; i < 6; i++) {
1637 for (i = 0; i < 6; i++) {
1672 int hours, minutes, seconds;
1684 s->
time_base = seconds + 60*(minutes + 60*hours);
1729 int chroma_format =
get_bits(gb, 2);
1793 !(
s->width &&
s->codec_tag ==
AV_RL32(
"MP4S"))) {
1794 if (
s->width &&
s->height &&
1796 s->context_reinit = 1;
1802 s->progressive_sequence =
1804 s->interlaced_dct = 0;
1807 "MPEG4 OBMC not supported (very likely buggy encoder)\n");
1811 ctx->vol_sprite_usage =
get_bits(gb, 2);
1827 ctx->num_sprite_warping_points =
get_bits(gb, 6);
1828 if (ctx->num_sprite_warping_points > 3) {
1830 "%d sprite_warping_points\n",
1831 ctx->num_sprite_warping_points);
1832 ctx->num_sprite_warping_points = 0;
1835 s->sprite_warping_accuracy =
get_bits(gb, 2);
1836 ctx->sprite_brightness_change =
get_bits1(gb);
1846 if (
s->quant_precision != 5)
1848 "quant precision %d\n",
s->quant_precision);
1849 if (
s->quant_precision<3 ||
s->quant_precision>9) {
1850 s->quant_precision = 5;
1853 s->quant_precision = 5;
1862 for (i = 0; i < 64; i++) {
1863 int j =
s->idsp.idct_permutation[i];
1865 s->intra_matrix[j] =
v;
1866 s->chroma_intra_matrix[j] =
v;
1869 s->inter_matrix[j] =
v;
1870 s->chroma_inter_matrix[j] =
v;
1876 for (i = 0; i < 64; i++) {
1884 s->intra_matrix[j] = last;
1885 s->chroma_intra_matrix[j] = last;
1889 for (; i < 64; i++) {
1891 s->intra_matrix[j] = last;
1892 s->chroma_intra_matrix[j] = last;
1899 for (i = 0; i < 64; i++) {
1907 s->inter_matrix[j] =
v;
1908 s->chroma_inter_matrix[j] =
v;
1912 for (; i < 64; i++) {
1914 s->inter_matrix[j] = last;
1915 s->chroma_inter_matrix[j] = last;
1925 s->quarter_sample = 0;
1934 int estimation_method =
get_bits(gb, 2);
1935 if (estimation_method < 2) {
1937 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1938 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1939 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1940 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1941 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1942 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1945 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1946 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1947 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1948 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1950 if (!
check_marker(gb,
"in complexity estimation part 1")) {
1955 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1956 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1957 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1958 ctx->cplx_estimation_trash_i += 4 *
get_bits1(gb);
1961 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1962 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1963 ctx->cplx_estimation_trash_b += 8 *
get_bits1(gb);
1964 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1965 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1966 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1968 if (!
check_marker(gb,
"in complexity estimation part 2")) {
1972 if (estimation_method == 1) {
1973 ctx->cplx_estimation_trash_i += 8 *
get_bits1(gb);
1974 ctx->cplx_estimation_trash_p += 8 *
get_bits1(gb);
1978 "Invalid Complexity estimation method %d\n",
1983 ctx->cplx_estimation_trash_i =
1984 ctx->cplx_estimation_trash_p =
1985 ctx->cplx_estimation_trash_b = 0;
1991 if (
s->data_partitioning)
1994 if (vo_ver_id != 1) {
1996 if (ctx->new_pred) {
2003 "reduced resolution VOP not supported\n");
2010 if (ctx->scalability) {
2012 int h_sampling_factor_n;
2013 int h_sampling_factor_m;
2014 int v_sampling_factor_n;
2015 int v_sampling_factor_m;
2020 h_sampling_factor_n =
get_bits(gb, 5);
2021 h_sampling_factor_m =
get_bits(gb, 5);
2022 v_sampling_factor_n =
get_bits(gb, 5);
2023 v_sampling_factor_m =
get_bits(gb, 5);
2026 if (h_sampling_factor_n == 0 || h_sampling_factor_m == 0 ||
2027 v_sampling_factor_n == 0 || v_sampling_factor_m == 0) {
2030 ctx->scalability = 0;
2041 s->avctx->framerate.den,
s->avctx->framerate.num,
2042 ctx->time_increment_bits,
2044 s->progressive_sequence,
2045 ctx->scalability ?
"scalability " :
"" ,
s->quarter_sample ?
"qpel " :
"",
2046 s->data_partitioning ?
"partition " :
"", ctx->rvlc ?
"rvlc " :
""
2063 int ver = 0, build = 0, ver2 = 0, ver3 = 0;
2074 e = sscanf(buf,
"DivX%dBuild%d%c", &ver, &build, &last);
2076 e = sscanf(buf,
"DivX%db%d%c", &ver, &build, &last);
2084 e = sscanf(buf,
"FFmpe%*[^b]b%d", &build) + 3;
2086 e = sscanf(buf,
"FFmpeg v%d.%d.%d / libavcodec build: %d", &ver, &ver2, &ver3, &build);
2088 e = sscanf(buf,
"Lavc%d.%d.%d", &ver, &ver2, &ver3) + 1;
2090 build = (ver << 16) + (ver2 << 8) + ver3;
2093 if (strcmp(buf,
"ffmpeg") == 0)
2100 e = sscanf(buf,
"XviD%d", &build);
2156 #define SET_QPEL_FUNC(postfix1, postfix2) \
2157 s->qdsp.put_ ## postfix1 = ff_put_ ## postfix2; \
2158 s->qdsp.put_no_rnd_ ## postfix1 = ff_put_no_rnd_ ## postfix2; \
2159 s->qdsp.avg_ ## postfix1 = ff_avg_ ## postfix2;
2203 "bugs: %X lavc_build:%d xvid_build:%d divx_version:%d divx_build:%d %s\n",
2207 if (CONFIG_MPEG4_DECODER && ctx->
xvid_build >= 0 &&
2221 int time_incr, time_increment;
2246 "time_increment_bits %d is invalid in relation to the current bitstream, this is likely caused by a missing VOL header\n", ctx->
time_increment_bits);
2261 "time_increment_bits set to %d bits, based on bitstream analysis\n", ctx->
time_increment_bits);
2271 time_increment =
get_bits(gb, ctx->time_increment_bits);
2274 s->last_time_base =
s->time_base;
2275 s->time_base += time_incr;
2276 s->time =
s->time_base *
s->avctx->framerate.num + time_increment;
2278 if (
s->time <
s->last_non_b_time) {
2282 s->time +=
s->avctx->framerate.num;
2285 s->pp_time =
s->time -
s->last_non_b_time;
2286 s->last_non_b_time =
s->time;
2288 s->time = (
s->last_time_base + time_incr) *
s->avctx->framerate.num + time_increment;
2289 s->pb_time =
s->pp_time - (
s->last_non_b_time -
s->time);
2290 if (
s->pp_time <=
s->pb_time ||
2291 s->pp_time <=
s->pp_time -
s->pb_time ||
2298 if (ctx->t_frame == 0)
2299 ctx->t_frame =
s->pb_time;
2300 if (ctx->t_frame == 0)
2302 s->pp_field_time = (
ROUNDED_DIV(
s->last_non_b_time, ctx->t_frame) -
2303 ROUNDED_DIV(
s->last_non_b_time -
s->pp_time, ctx->t_frame)) * 2;
2305 ROUNDED_DIV(
s->last_non_b_time -
s->pp_time, ctx->t_frame)) * 2;
2306 if (
s->pp_field_time <=
s->pb_field_time ||
s->pb_field_time <= 1) {
2307 s->pb_field_time = 2;
2308 s->pp_field_time = 4;
2309 if (!
s->progressive_sequence)
2314 if (
s->avctx->framerate.den)
2374 if (!
s->progressive_sequence) {
2378 s->alternate_scan = 0;
2381 if (
s->alternate_scan) {
2398 if (ctx->sprite_brightness_change)
2400 "sprite_brightness_change not supported\n");
2406 s->chroma_qscale =
s->qscale =
get_bits(gb,
s->quant_precision);
2407 if (
s->qscale == 0) {
2409 "Error, header damaged or not MPEG4 header (qscale=0)\n");
2415 if (
s->f_code == 0) {
2417 "Error, header damaged or not MPEG4 header (f_code=0)\n");
2426 if (
s->b_code == 0) {
2428 "Error, header damaged or not MPEG4 header (b_code=0)\n");
2437 "qp:%d fc:%d,%d %s size:%d pro:%d alt:%d top:%d %spel part:%d resync:%d w:%d a:%d rnd:%d vot:%d%s dc:%d ce:%d/%d/%d time:%"PRId64
" tincr:%d\n",
2438 s->qscale,
s->f_code,
s->b_code,
2440 gb->size_in_bits,
s->progressive_sequence,
s->alternate_scan,
2441 s->top_field_first,
s->quarter_sample ?
"q" :
"h",
2442 s->data_partitioning, ctx->resync_marker,
2443 ctx->num_sprite_warping_points,
s->sprite_warping_accuracy,
2444 1 -
s->no_rounding,
s->vo_type,
2445 ctx->vol_control_parameters ?
" VOLC" :
" ", ctx->intra_dc_threshold,
2446 ctx->cplx_estimation_trash_i, ctx->cplx_estimation_trash_p,
2447 ctx->cplx_estimation_trash_b,
2453 if (!ctx->scalability) {
2457 if (ctx->enhancement_type) {
2458 int load_backward_shape =
get_bits1(gb);
2459 if (load_backward_shape)
2461 "load backward shape isn't supported\n");
2469 if (
s->vo_type == 0 && ctx->vol_control_parameters == 0 &&
2470 ctx->divx_version == -1 &&
s->picture_number == 0) {
2472 "looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag\n");
2476 s->picture_number++;
2483 s->h_edge_pos =
s->width;
2484 s->v_edge_pos =
s->height;
2498 unsigned startcode,
v;
2523 startcode = ((startcode << 8) | v) & 0xffffffff;
2525 if ((startcode & 0xFFFFFF00) != 0x100)
2530 if (startcode <= 0x11F)
2532 else if (startcode <= 0x12F)
2534 else if (startcode <= 0x13F)
2536 else if (startcode <= 0x15F)
2538 else if (startcode <= 0x1AF)
2540 else if (startcode == 0x1B0)
2542 else if (startcode == 0x1B1)
2544 else if (startcode == 0x1B2)
2546 else if (startcode == 0x1B3)
2548 else if (startcode == 0x1B4)
2550 else if (startcode == 0x1B5)
2552 else if (startcode == 0x1B6)
2554 else if (startcode == 0x1B7)
2556 else if (startcode == 0x1B8)
2558 else if (startcode == 0x1B9)
2560 else if (startcode == 0x1BA)
2562 else if (startcode == 0x1BB)
2564 else if (startcode == 0x1BC)
2566 else if (startcode == 0x1BD)
2568 else if (startcode == 0x1BE)
2570 else if (startcode == 0x1BF)
2572 else if (startcode == 0x1C0)
2574 else if (startcode == 0x1C1)
2576 else if (startcode == 0x1C2)
2578 else if (startcode == 0x1C3)
2580 else if (startcode <= 0x1C5)
2582 else if (startcode <= 0x1FF)
2587 if (startcode >= 0x120 && startcode <= 0x12F) {
2613 static int done = 0;
2648 int startcode_found = 0;
2650 if (buf_size - current_pos > 7) {
2653 for (i = current_pos; i < buf_size - 4; i++)
2658 buf[i + 3] == 0xB6) {
2659 startcode_found = !(buf[i + 4] & 0x40);
2664 if (startcode_found) {
2667 "wasteful way to store B-frames ('packed B-frames'). "
2668 "Consider using the mpeg4_unpack_bframes bitstream filter to fix it.\n");
2673 buf_size - current_pos);
2679 buf_size - current_pos);
2701 if (CONFIG_MPEG4_DECODER && !init && s1->
xvid_build >= 0)
2761 "MPEG4 Video Decoder",
2788 #if CONFIG_MPEG4_VDPAU_DECODER
2789 static const AVClass mpeg4_vdpau_class = {
2790 "MPEG4 Video VDPAU Decoder",
2796 AVCodec ff_mpeg4_vdpau_decoder = {
2797 .
name =
"mpeg4_vdpau",
2809 .priv_class = &mpeg4_vdpau_class,
#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE
int bitstream_buffer_size
static unsigned int show_bits_long(GetBitContext *s, int n)
Show 0-32 bits.
uint16_t sprite_traj[4][2]
sprite trajectory points
void ff_init_block_index(MpegEncContext *s)
static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
ScanTable intra_v_scantable
static int shift(int a, int b)
RLTable ff_mpeg4_rl_intra
const uint8_t ff_mpeg4_c_dc_scale_table[32]
mpeg2/4 4:2:0, h264 default for 4:2:0
#define FF_PROFILE_MPEG4_ADVANCED_CORE
#define MV_TYPE_FIELD
2 vectors, one per field
#define FF_PROFILE_MPEG4_MAIN
int sprite_warping_accuracy
int last_mv[2][2][2]
last MV, used for MV prediction in MPEG1 & B-frame MPEG4
av_cold void ff_mpeg4videodec_static_init(void)
int ff_mpeg4_frame_end(AVCodecContext *avctx, const uint8_t *buf, int buf_size)
#define SLICE_NOEND
no end marker or error found but mb count exceeded
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define LIBAVUTIL_VERSION_INT
static void skip_bits_long(GetBitContext *s, int n)
#define MB_TYPE_B_VLC_BITS
static av_cold int init(AVCodecContext *avctx)
VLC ff_h263_intra_MCBPC_vlc
int resync_marker
could this stream contain resync markers
#define CODEC_CAP_TRUNCATED
static int mpeg4_decode_gop_header(MpegEncContext *s, GetBitContext *gb)
int16_t(*[3] ac_val)[16]
used for mpeg4 AC prediction, all 3 arrays must be continuous
#define SKIP_COUNTER(name, gb, num)
#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE
uint8_t * bitstream_buffer
void(* clear_blocks)(int16_t *blocks)
#define AV_EF_AGGRESSIVE
consider things that a sane encoder should not do as an error
void ff_mpeg4_pred_ac(MpegEncContext *s, int16_t *block, int n, int dir)
Predict the ac.
AVRational sample_aspect_ratio
sample aspect ratio (0 if unknown) That is the width of a pixel divided by the height of the pixel...
static av_cold int decode_init(AVCodecContext *avctx)
#define FF_PROFILE_MPEG4_N_BIT
void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
Same behaviour av_fast_malloc but the buffer has additional FF_INPUT_BUFFER_PADDING_SIZE at the end w...
int real_sprite_warping_points
int padding_bug_score
used to detect the VERY common padding bug in MPEG4
void ff_thread_await_progress(ThreadFrame *f, int n, int field)
Wait for earlier decoding threads to finish reference pictures.
int mb_num
number of MBs of a picture
int time_base
time in seconds of last I,P,S Frame
int16_t * ff_h263_pred_motion(MpegEncContext *s, int block, int dir, int *px, int *py)
void ff_clean_intra_table_entries(MpegEncContext *s)
Clean dc, ac, coded_block for the current non-intra MB.
AVRational time_base
This is the fundamental unit of time (in seconds) in terms of which frame timestamps are represented...
int ff_mpeg4_workaround_bugs(AVCodecContext *avctx)
#define USES_LIST(a, list)
#define FF_BUG_QPEL_CHROMA2
#define USER_DATA_STARTCODE
int mb_num_left
number of MBs left in this video packet (for partitioned Slices only)
int8_t * max_run[2]
encoding & decoding
#define MV_DIRECT
bidirectional mode where the difference equals the MV of the last P/S/I-Frame (mpeg4) ...
#define av_assert2(cond)
assert() equivalent, that does lie in speed critical code.
static int mpeg4_decode_mb(MpegEncContext *s, int16_t block[6][64])
#define INIT_VLC_STATIC(vlc, bits, a, b, c, d, e, f, g, static_size)
const uint16_t ff_mpeg4_resync_prefix[8]
const uint16_t ff_sprite_trajectory_tab[15][2]
static av_cold int end(AVCodecContext *avctx)
uint8_t * pred_dir_table
used to store pred_dir for partitioned decoding
Multithreading support functions.
#define CODEC_CAP_HWACCEL_VDPAU
Codec can export data for HW decoding (VDPAU).
#define FF_PROFILE_UNKNOWN
Picture current_picture
copy of the current picture structure.
const uint8_t ff_mpeg4_DCtab_chrom[13][2]
#define CODEC_CAP_DR1
Codec uses get_buffer() for allocating buffers and supports custom allocators.
static int decode_user_data(Mpeg4DecContext *ctx, GetBitContext *gb)
Decode the user data stuff in the header.
AVRational av_mul_q(AVRational b, AVRational c)
Multiply two rationals.
static int get_bits_count(const GetBitContext *s)
#define FF_BUG_NO_PADDING
int8_t * max_level[2]
encoding & decoding
#define AV_LOG_VERBOSE
Detailed information.
av_cold void ff_mpv_idct_init(MpegEncContext *s)
int mb_height
number of MBs horizontally & vertically
int codec_tag
internal codec_tag upper case converted from avctx codec_tag
const AVRational ff_h263_pixel_aspect[16]
int intra_dc_threshold
QP above which the ac VLC should be used for intra dc.
enum AVChromaLocation chroma_sample_location
This defines the location of chroma samples.
#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE
static int ff_mpeg4_pred_dc(MpegEncContext *s, int n, int level, int *dir_ptr, int encoding)
Predict the dc.
static void ff_update_block_index(MpegEncContext *s)
void ff_set_qscale(MpegEncContext *s, int qscale)
set qscale and update qscale dependent variables.
int sprite_offset[2][2]
sprite offset[isChroma][isMVY]
#define ROUNDED_DIV(a, b)
#define FF_BUG_QPEL_CHROMA
#define AV_EF_IGNORE_ERR
ignore errors and continue
av_cold void ff_xvid_idct_init(IDCTDSPContext *c, AVCodecContext *avctx)
#define FF_BUG_DIRECT_BLOCKSIZE
static int get_bits_left(GetBitContext *gb)
int16_t * dc_val[3]
used for mpeg4 DC prediction, all 3 arrays must be continuous
#define UPDATE_CACHE(name, gb)
static double alpha(void *priv, double x, double y)
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
int has_b_frames
Size of the frame reordering buffer in the decoder.
void ff_er_add_slice(ERContext *s, int startx, int starty, int endx, int endy, int status)
Add a slice.
int mb_skipped
MUST BE SET only during DECODING.
#define CODEC_CAP_DELAY
Encoder or decoder requires flushing with NULL input at the end in order to give the complete and cor...
int partitioned_frame
is current frame partitioned
int ff_mpeg4_decode_partitions(Mpeg4DecContext *ctx)
Decode the first and second partition.
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification. ...
static int get_amv(Mpeg4DecContext *ctx, int n)
Get the average motion vector for a GMC MB.
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define INTER_MCBPC_VLC_BITS
#define FF_BUG_AUTODETECT
autodetection
void ff_mpeg4_init_direct_mv(MpegEncContext *s)
const char * name
Name of the codec implementation.
#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE
int quarter_sample
1->qpel, 0->half pel ME/MC
int low_delay
no reordering needed / has no b-frames
#define SET_QPEL_FUNC(postfix1, postfix2)
#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME
int(* decode_mb)(struct MpegEncContext *s, int16_t block[6][64])
#define CLOSE_READER(name, gb)
#define FF_PROFILE_MPEG4_HYBRID
#define INIT_VLC_RL(rl, static_size)
#define CODEC_FLAG_LOW_DELAY
Force low delay.
static int check_marker(GetBitContext *s, const char *msg)
void ff_mpeg_flush(AVCodecContext *avctx)
#define SKIP_BITS(name, gb, num)
#define ONLY_IF_THREADS_ENABLED(x)
Define a function with only the non-default version specified.
int resync_mb_x
x position of last resync marker
const uint8_t ff_alternate_horizontal_scan[64]
int ff_h263_decode_init(AVCodecContext *avctx)
#define FF_DEBUG_STARTCODE
int sprite_delta[2][2]
sprite_delta [isY][isMVY]
const uint8_t ff_mpeg4_DCtab_lum[13][2]
uint8_t ff_mpeg4_static_rl_table_store[3][2][2 *MAX_RUN+MAX_LEVEL+3]
VLC ff_h263_inter_MCBPC_vlc
int ff_h263_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, AVPacket *avpkt)
static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *gb)
static const int mb_type_b_map[4]
int err_recognition
Error recognition; may misdetect some more or less valid parts as errors.
#define FF_PROFILE_MPEG4_SIMPLE
#define CODEC_CAP_DRAW_HORIZ_BAND
Decoder can use draw_horiz_band callback.
const uint8_t ff_mpeg4_y_dc_scale_table[32]
static int mpeg4_decode_partition_a(Mpeg4DecContext *ctx)
Decode first partition.
int idct_algo
IDCT algorithm, see FF_IDCT_* below.
static int mpeg4_decode_dc(MpegEncContext *s, int n, int *dir_ptr)
Decode the dc value.
#define MB_TYPE_INTERLACED
int16_t(*[2] motion_val)[2]
enum AVPixelFormat ff_h263_hwaccel_pixfmt_list_420[]
unsigned int allocated_bitstream_buffer_size
static unsigned int show_bits(GetBitContext *s, int n)
Show 1-25 bits.
int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx)
Decode the next video packet.
#define LAST_SKIP_BITS(name, gb, num)
static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE(*table)[2], int bits, int max_depth)
Parse a vlc code.
int block_last_index[12]
last non zero coefficient in block
uint8_t idct_permutation[64]
IDCT input permutation.
int ticks_per_frame
For some codecs, the time base is closer to the field rate than the frame rate.
int vol_control_parameters
does the stream contain the low_delay flag, used to work around buggy encoders.
const int16_t ff_mpeg4_default_non_intra_matrix[64]
uint8_t * mbintra_table
used to avoid setting {ac, dc, cbp}-pred stuff to zero on inter MB decoding
int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
RL_VLC_ELEM * rl_vlc[32]
decoding only
#define SHOW_UBITS(name, gb, num)
#define SPRITE_TRAJ_VLC_BITS
int block_index[6]
index to current MB in block based arrays with edges
static void flush(AVCodecContext *avctx)
#define MV_TYPE_16X16
1 vector for the whole mb
int first_slice_line
used in mpeg4 too to handle resync markers
static int mpeg4_decode_partitioned_mb(MpegEncContext *s, int16_t block[6][64])
decode partition C of one MB.
#define FF_PROFILE_MPEG4_CORE
#define AV_LOG_INFO
Standard information.
main external API structure.
static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb)
ScanTable intra_scantable
int height
picture size. must be a multiple of 16
static int get_xbits(GetBitContext *s, int n)
read mpeg1 dc style vlc (sign bit + mantissa with no MSB).
#define OPEN_READER(name, gb)
av_cold int ff_rl_init(RLTable *rl, uint8_t static_store[2][2 *MAX_RUN+MAX_LEVEL+3])
#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE
MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstre...
#define SLICE_END
end marker found
int data_partitioning
data partitioning flag from header
int showed_packed_warning
flag for having shown the warning about invalid Divx B-frames
static unsigned int get_bits1(GetBitContext *s)
BYTE int const BYTE int int int height
static void skip_bits1(GetBitContext *s)
static int mpeg4_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Describe the class of an AVClass context structure.
ScanTable intra_h_scantable
static const AVProfile profiles[]
static void skip_bits(GetBitContext *s, int n)
static const AVProfile mpeg4_video_profiles[]
uint8_t * cbp_table
used to store cbp, ac_pred for partitioned decoding
#define FF_BUG_XVID_ILACE
rational number numerator/denominator
int ff_mpeg4_decode_picture_header(Mpeg4DecContext *ctx, GetBitContext *gb)
Decode mpeg4 headers.
#define GET_CACHE(name, gb)
const uint8_t ff_zigzag_direct[64]
#define SKIP_CACHE(name, gb, num)
const int16_t ff_mpeg4_default_intra_matrix[64]
int allocate_progress
Whether to allocate progress for frame threading.
int f_code
forward MV resolution
static unsigned int get_bits_long(GetBitContext *s, int n)
Read 0-32 bits.
int ff_mpeg4_set_direct_mv(MpegEncContext *s, int mx, int my)
int sprite_shift[2]
sprite shift [isChroma]
int pict_type
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B, ...
const uint8_t ff_mpeg4_dc_threshold[8]
int h263_pred
use mpeg4/h263 ac/dc predictions
static int64_t pts
Global timestamp for the audio frames.
int ff_mpeg4_get_video_packet_prefix_length(MpegEncContext *s)
#define FF_BUG_HPEL_CHROMA
static av_always_inline AVRational av_inv_q(AVRational q)
Invert a rational.
#define FF_ASPECT_EXTENDED
#define FF_DEBUG_PICT_INFO
int mv[2][4][2]
motion vectors for a macroblock first coordinate : 0 = forward 1 = backward second " : depend...
int b8_stride
2*mb_width+1 used for some 8x8 block arrays to allow simple addressing
Picture * next_picture_ptr
pointer to the next picture (for bidir pred)
struct AVCodecContext * avctx
static int mpeg4_is_resync(Mpeg4DecContext *ctx)
check if the next stuff is a resync marker or the end.
static int decode(AVCodecContext *avctx, void *data, int *got_sub, AVPacket *avpkt)
#define SHOW_SBITS(name, gb, num)
static VLC sprite_trajectory
GLint GLenum GLboolean GLsizei stride
static const AVOption mpeg4_options[]
common internal api header.
int mb_stride
mb_width+1 used for some arrays to allow simple addressing of left & top MBs without sig11 ...
#define CODEC_CAP_FRAME_THREADS
Codec supports frame-level multithreading.
#define AV_EF_BITSTREAM
detect bitstream specification deviations
static int mpeg4_decode_partition_b(MpegEncContext *s, int mb_count)
decode second partition.
const uint8_t ff_alternate_vertical_scan[64]
static const AVClass mpeg4_class
int ff_h263_decode_end(AVCodecContext *avctx)
av_cold void ff_init_scantable(uint8_t *permutation, ScanTable *st, const uint8_t *src_scantable)
struct AVCodecInternal * internal
Private context used for internal data.
int resync_mb_y
y position of last resync marker
int16_t(* block)[64]
points to one of the following blocks
VLC_TYPE(* table)[2]
code, bits
Picture next_picture
copy of the next picture structure.
static int decode_new_pred(Mpeg4DecContext *ctx, GetBitContext *gb)
#define AV_EF_COMPLIANT
consider all spec non compliances as errors
static const uint8_t * align_get_bits(GetBitContext *s)
static int mpeg4_decode_profile_level(MpegEncContext *s, GetBitContext *gb)
int chroma_qscale
chroma QP
uint8_t pi<< 24) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0f/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_U8, uint8_t,(*(constuint8_t *) pi-0x80)*(1.0/(1<< 7))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S16, int16_t,(*(constint16_t *) pi >>8)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0f/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S16, int16_t,*(constint16_t *) pi *(1.0/(1<< 15))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_S32, int32_t,(*(constint32_t *) pi >>24)+0x80) CONV_FUNC_GROUP(AV_SAMPLE_FMT_FLT, float, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0f/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_DBL, double, AV_SAMPLE_FMT_S32, int32_t,*(constint32_t *) pi *(1.0/(1U<< 31))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_FLT, float, av_clip_uint8(lrintf(*(constfloat *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_FLT, float, av_clip_int16(lrintf(*(constfloat *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_FLT, float, av_clipl_int32(llrintf(*(constfloat *) pi *(1U<< 31)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_U8, uint8_t, AV_SAMPLE_FMT_DBL, double, av_clip_uint8(lrint(*(constdouble *) pi *(1<< 7))+0x80)) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S16, int16_t, AV_SAMPLE_FMT_DBL, double, av_clip_int16(lrint(*(constdouble *) pi *(1<< 15)))) CONV_FUNC_GROUP(AV_SAMPLE_FMT_S32, int32_t, AV_SAMPLE_FMT_DBL, double, av_clipl_int32(llrint(*(constdouble *) pi *(1U<< 31))))#defineSET_CONV_FUNC_GROUP(ofmt, ifmt) staticvoidset_generic_function(AudioConvert *ac){}voidff_audio_convert_free(AudioConvert **ac){if(!*ac) return;ff_dither_free(&(*ac) ->dc);av_freep(ac);}AudioConvert *ff_audio_convert_alloc(AVAudioResampleContext *avr, enumAVSampleFormatout_fmt, enumAVSampleFormatin_fmt, intchannels, intsample_rate, intapply_map){AudioConvert *ac;intin_planar, out_planar;ac=av_mallocz(sizeof(*ac));if(!ac) returnNULL;ac->avr=avr;ac->out_fmt=out_fmt;ac->in_fmt=in_fmt;ac->channels=channels;ac->apply_map=apply_map;if(avr->dither_method!=AV_RESAMPLE_DITHER_NONE &&av_get_packed_sample_fmt(out_fmt)==AV_SAMPLE_FMT_S16 &&av_get_bytes_per_sample(in_fmt)>2){ac->dc=ff_dither_alloc(avr, out_fmt, in_fmt, channels, sample_rate, apply_map);if(!ac->dc){av_free(ac);returnNULL;}returnac;}in_planar=ff_sample_fmt_is_planar(in_fmt, channels);out_planar=ff_sample_fmt_is_planar(out_fmt, channels);if(in_planar==out_planar){ac->func_type=CONV_FUNC_TYPE_FLAT;ac->planes=in_planar?ac->channels:1;}elseif(in_planar) ac->func_type=CONV_FUNC_TYPE_INTERLEAVE;elseac->func_type=CONV_FUNC_TYPE_DEINTERLEAVE;set_generic_function(ac);if(ARCH_AARCH64) ff_audio_convert_init_aarch64(ac);if(ARCH_ARM) ff_audio_convert_init_arm(ac);if(ARCH_X86) ff_audio_convert_init_x86(ac);returnac;}intff_audio_convert(AudioConvert *ac, AudioData *out, AudioData *in){intuse_generic=1;intlen=in->nb_samples;intp;if(ac->dc){av_log(ac->avr, AV_LOG_TRACE,"%dsamples-audio_convert:%sto%s(dithered)\n", len, av_get_sample_fmt_name(ac->in_fmt), av_get_sample_fmt_name(ac->out_fmt));returnff_convert_dither(ac-> dc
int ff_h263_decode_motion(MpegEncContext *s, int pred, int f_code)
#define FF_PROFILE_MPEG4_SIMPLE_STUDIO
uint32_t * mb_type
types and macros are defined in mpegutils.h
int time_increment_bits
number of bits to represent the fractional part of time
int workaround_bugs
workaround bugs in encoders which cannot be detected automatically
#define FRAME_SKIPPED
return value for header parsers if frame is not coded
#define FF_PROFILE_MPEG4_ADVANCED_CODING
int num_sprite_warping_points
#define MV_TYPE_8X8
4 vectors (h263, mpeg4 4MV)
int b_code
backward MV resolution for B Frames (mpeg4)
#define FF_PROFILE_MPEG4_CORE_SCALABLE
uint64_t_TMPL AV_WL64 unsigned int_TMPL AV_RL32
AVPixelFormat
Pixel format.
const uint8_t ff_mb_type_b_tab[4][2]
static int mpeg4_decode_block(Mpeg4DecContext *ctx, int16_t *block, int n, int coded, int intra, int rvlc)
Decode a block.
#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION
#define AV_NOPTS_VALUE
Undefined timestamp value.
#define INTRA_MCBPC_VLC_BITS