comparison msmpeg4.c @ 347:3c5266cda02d libavcodec

fixing msmpeg4v3 dc-scale for quantizers 24-31
author michaelni
date Tue, 30 Apr 2002 01:29:29 +0000
parents ac677a84d5df
children fce0a2520551
comparison
equal deleted inserted replaced
346:c2f789fe4945 347:3c5266cda02d
409 msmpeg4_encode_block(s, block[i], i); 409 msmpeg4_encode_block(s, block[i], i);
410 } 410 }
411 } 411 }
412 412
413 413
414 /* strongly inspirated from MPEG4, but not exactly the same ! */ 414 #if 0
415 /* identical to mpeg4 for msmpeg4v3 but not msmpeg4v2 */
415 void msmpeg4_dc_scale(MpegEncContext * s) 416 void msmpeg4_dc_scale(MpegEncContext * s)
416 { 417 {
417 if (s->qscale < 5 || s->msmpeg4_version==2){ 418 if (s->qscale < 5 || s->msmpeg4_version==2){
418 s->y_dc_scale = 8; 419 s->y_dc_scale = 8;
419 s->c_dc_scale = 8; 420 s->c_dc_scale = 8;
420 }else if (s->qscale < 9){ 421 }else if (s->qscale < 9){
421 s->y_dc_scale = 2 * s->qscale; 422 s->y_dc_scale = 2 * s->qscale;
422 s->c_dc_scale = (s->qscale + 13)>>1; 423 s->c_dc_scale = (s->qscale + 13)>>1;
423 }else{ 424 }else if(s->qscale < 25){
424 s->y_dc_scale = s->qscale + 8; 425 s->y_dc_scale = s->qscale + 8;
425 s->c_dc_scale = (s->qscale + 13)>>1; 426 s->c_dc_scale = (s->qscale + 13)>>1;
426 } 427 }else{
427 } 428 s->y_dc_scale = 2 * s->qscale - 16;
429 s->c_dc_scale = s->qscale - 6;
430 }
431 }
432 #endif
428 433
429 /* dir = 0: left, dir = 1: top prediction */ 434 /* dir = 0: left, dir = 1: top prediction */
430 static int msmpeg4_pred_dc(MpegEncContext * s, int n, 435 static int msmpeg4_pred_dc(MpegEncContext * s, int n,
431 INT16 **dc_val_ptr, int *dir_ptr) 436 INT16 **dc_val_ptr, int *dir_ptr)
432 { 437 {