Mercurial > libavcodec.hg
comparison h263.c @ 1983:1205bf58c420 libavcodec
H.263 MCBPC fix
author | michael |
---|---|
date | Mon, 26 Apr 2004 21:46:01 +0000 |
parents | 5dfde318d44a |
children | 7bd3932bc918 |
comparison
equal
deleted
inserted
replaced
1982:800db77ec7c8 | 1983:1205bf58c420 |
---|---|
494 } | 494 } |
495 for(i=s->mb_num-2; i>=0; i--){ | 495 for(i=s->mb_num-2; i>=0; i--){ |
496 if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i+1] ] >2) | 496 if(qscale_table[ s->mb_index2xy[i] ] - qscale_table[ s->mb_index2xy[i+1] ] >2) |
497 qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i+1] ]+2; | 497 qscale_table[ s->mb_index2xy[i] ]= qscale_table[ s->mb_index2xy[i+1] ]+2; |
498 } | 498 } |
499 | |
500 if(s->codec_id != CODEC_ID_H263P){ | |
501 for(i=1; i<s->mb_num; i++){ | |
502 int mb_xy= s->mb_index2xy[i]; | |
503 | |
504 if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){ | |
505 s->mb_type[mb_xy]&= ~CANDIDATE_MB_TYPE_INTER4V; | |
506 s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER; | |
507 } | |
508 } | |
509 } | |
499 } | 510 } |
500 | 511 |
501 /** | 512 /** |
502 * modify mb_type & qscale so that encoding is acually possible in mpeg4 | 513 * modify mb_type & qscale so that encoding is acually possible in mpeg4 |
503 */ | 514 */ |
505 int i; | 516 int i; |
506 int8_t * const qscale_table= s->current_picture.qscale_table; | 517 int8_t * const qscale_table= s->current_picture.qscale_table; |
507 | 518 |
508 ff_clean_h263_qscales(s); | 519 ff_clean_h263_qscales(s); |
509 | 520 |
510 for(i=1; i<s->mb_num; i++){ | |
511 int mb_xy= s->mb_index2xy[i]; | |
512 | |
513 if(qscale_table[mb_xy] != qscale_table[s->mb_index2xy[i-1]] && (s->mb_type[mb_xy]&CANDIDATE_MB_TYPE_INTER4V)){ | |
514 s->mb_type[mb_xy]&= ~CANDIDATE_MB_TYPE_INTER4V; | |
515 s->mb_type[mb_xy]|= CANDIDATE_MB_TYPE_INTER; | |
516 } | |
517 } | |
518 | |
519 if(s->pict_type== B_TYPE){ | 521 if(s->pict_type== B_TYPE){ |
520 int odd=0; | 522 int odd=0; |
521 /* ok, come on, this isnt funny anymore, theres more code for handling this mpeg4 mess than | 523 /* ok, come on, this isnt funny anymore, theres more code for handling this mpeg4 mess than |
522 for the actual adaptive quantization */ | 524 for the actual adaptive quantization */ |
523 | 525 |