Revision ce5e49b0 libavcodec/mpeg12enc.c
libavcodec/mpeg12enc.c  

354  354 
put_bits(&s>pb, 16, 0xFFFF); /* vbv_delay */ 
355  355  
356  356 
// RAL: Forward f_code also needed for B frames 
357 
if (s>pict_type == FF_P_TYPE  s>pict_type == FF_B_TYPE) {


357 
if (s>pict_type == AV_PICTURE_TYPE_P  s>pict_type == AV_PICTURE_TYPE_B) {


358  358 
put_bits(&s>pb, 1, 0); /* half pel coordinates */ 
359  359 
if(s>codec_id == CODEC_ID_MPEG1VIDEO) 
360  360 
put_bits(&s>pb, 3, s>f_code); /* forward_f_code */ 
...  ...  
363  363 
} 
364  364  
365  365 
// RAL: Backward f_code necessary for B frames 
366 
if (s>pict_type == FF_B_TYPE) {


366 
if (s>pict_type == AV_PICTURE_TYPE_B) {


367  367 
put_bits(&s>pb, 1, 0); /* half pel coordinates */ 
368  368 
if(s>codec_id == CODEC_ID_MPEG1VIDEO) 
369  369 
put_bits(&s>pb, 3, s>b_code); /* backward_f_code */ 
...  ...  
377  377 
if(s>codec_id == CODEC_ID_MPEG2VIDEO){ 
378  378 
put_header(s, EXT_START_CODE); 
379  379 
put_bits(&s>pb, 4, 8); //pic ext 
380 
if (s>pict_type == FF_P_TYPE  s>pict_type == FF_B_TYPE) {


380 
if (s>pict_type == AV_PICTURE_TYPE_P  s>pict_type == AV_PICTURE_TYPE_B) {


381  381 
put_bits(&s>pb, 4, s>f_code); 
382  382 
put_bits(&s>pb, 4, s>f_code); 
383  383 
}else{ 
384  384 
put_bits(&s>pb, 8, 255); 
385  385 
} 
386 
if (s>pict_type == FF_B_TYPE) {


386 
if (s>pict_type == AV_PICTURE_TYPE_B) {


387  387 
put_bits(&s>pb, 4, s>b_code); 
388  388 
put_bits(&s>pb, 4, s>b_code); 
389  389 
}else{ 
...  ...  
456  456  
457  457 
if (cbp == 0 && !first_mb && s>mv_type == MV_TYPE_16X16 && 
458  458 
(mb_x != s>mb_width  1  (mb_y != s>mb_height  1 && s>codec_id == CODEC_ID_MPEG1VIDEO)) && 
459 
((s>pict_type == FF_P_TYPE && (motion_x  motion_y) == 0) 


460 
(s>pict_type == FF_B_TYPE && s>mv_dir == s>last_mv_dir && (((s>mv_dir & MV_DIR_FORWARD) ? ((s>mv[0][0][0]  s>last_mv[0][0][0])(s>mv[0][0][1]  s>last_mv[0][0][1])) : 0) 


459 
((s>pict_type == AV_PICTURE_TYPE_P && (motion_x  motion_y) == 0) 


460 
(s>pict_type == AV_PICTURE_TYPE_B && s>mv_dir == s>last_mv_dir && (((s>mv_dir & MV_DIR_FORWARD) ? ((s>mv[0][0][0]  s>last_mv[0][0][0])(s>mv[0][0][1]  s>last_mv[0][0][1])) : 0) 


461  461 
((s>mv_dir & MV_DIR_BACKWARD) ? ((s>mv[1][0][0]  s>last_mv[1][0][0])(s>mv[1][0][1]  s>last_mv[1][0][1])) : 0)) == 0))) { 
462  462 
s>mb_skip_run++; 
463  463 
s>qscale = s>dquant; 
464  464 
s>skip_count++; 
465  465 
s>misc_bits++; 
466  466 
s>last_bits++; 
467 
if(s>pict_type == FF_P_TYPE){


467 
if(s>pict_type == AV_PICTURE_TYPE_P){


468  468 
s>last_mv[0][1][0]= s>last_mv[0][0][0]= 
469  469 
s>last_mv[0][1][1]= s>last_mv[0][0][1]= 0; 
470  470 
} 
...  ...  
476  476 
encode_mb_skip_run(s, s>mb_skip_run); 
477  477 
} 
478  478  
479 
if (s>pict_type == FF_I_TYPE) {


479 
if (s>pict_type == AV_PICTURE_TYPE_I) {


480  480 
if(s>dquant && cbp){ 
481  481 
put_mb_modes(s, 2, 1, 0, 0); /* macroblock_type : macroblock_quant = 1 */ 
482  482 
put_qscale(s); 
...  ...  
497  497 
s>misc_bits+= get_bits_diff(s); 
498  498 
s>i_count++; 
499  499 
memset(s>last_mv, 0, sizeof(s>last_mv)); 
500 
} else if (s>pict_type == FF_P_TYPE) {


500 
} else if (s>pict_type == AV_PICTURE_TYPE_P) {


501  501 
if(s>mv_type == MV_TYPE_16X16){ 
502  502 
if (cbp != 0) { 
503  503 
if ((motion_xmotion_y) == 0) { 
Also available in: Unified diff