comparison error_resilience.c @ 2979:bfabfdf9ce55 libavcodec

COSMETICS: tabs --> spaces, some prettyprinting
author diego
date Thu, 22 Dec 2005 01:10:11 +0000
parents ef2149182f1c
children 0b546eab515d
comparison
equal deleted inserted replaced
2978:403183bbb505 2979:bfabfdf9ce55
106 } 106 }
107 } 107 }
108 108
109 /** 109 /**
110 * guess the dc of blocks which dont have a undamaged dc 110 * guess the dc of blocks which dont have a undamaged dc
111 * @param w width in 8 pixel blocks 111 * @param w width in 8 pixel blocks
112 * @param h height in 8 pixel blocks 112 * @param h height in 8 pixel blocks
113 */ 113 */
114 static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){ 114 static void guess_dc(MpegEncContext *s, int16_t *dc, int w, int h, int stride, int is_luma){
115 int b_x, b_y; 115 int b_x, b_y;
116 116
117 for(b_y=0; b_y<h; b_y++){ 117 for(b_y=0; b_y<h; b_y++){
190 } 190 }
191 } 191 }
192 192
193 /** 193 /**
194 * simple horizontal deblocking filter used for error resilience 194 * simple horizontal deblocking filter used for error resilience
195 * @param w width in 8 pixel blocks 195 * @param w width in 8 pixel blocks
196 * @param h height in 8 pixel blocks 196 * @param h height in 8 pixel blocks
197 */ 197 */
198 static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){ 198 static void h_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
199 int b_x, b_y; 199 int b_x, b_y;
200 uint8_t *cm = cropTbl + MAX_NEG_CROP; 200 uint8_t *cm = cropTbl + MAX_NEG_CROP;
201 201
250 } 250 }
251 } 251 }
252 252
253 /** 253 /**
254 * simple vertical deblocking filter used for error resilience 254 * simple vertical deblocking filter used for error resilience
255 * @param w width in 8 pixel blocks 255 * @param w width in 8 pixel blocks
256 * @param h height in 8 pixel blocks 256 * @param h height in 8 pixel blocks
257 */ 257 */
258 static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){ 258 static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int stride, int is_luma){
259 int b_x, b_y; 259 int b_x, b_y;
260 uint8_t *cm = cropTbl + MAX_NEG_CROP; 260 uint8_t *cm = cropTbl + MAX_NEG_CROP;
261 261
346 s->mv_dir = MV_DIR_FORWARD; 346 s->mv_dir = MV_DIR_FORWARD;
347 s->mb_intra=0; 347 s->mb_intra=0;
348 s->mv_type = MV_TYPE_16X16; 348 s->mv_type = MV_TYPE_16X16;
349 s->mb_skipped=0; 349 s->mb_skipped=0;
350 350
351 s->dsp.clear_blocks(s->block[0]); 351 s->dsp.clear_blocks(s->block[0]);
352 352
353 s->mb_x= mb_x; 353 s->mb_x= mb_x;
354 s->mb_y= mb_y; 354 s->mb_y= mb_y;
355 s->mv[0][0][0]= 0; 355 s->mv[0][0][0]= 0;
356 s->mv[0][0][1]= 0; 356 s->mv[0][0][1]= 0;
474 s->mv_dir = MV_DIR_FORWARD; 474 s->mv_dir = MV_DIR_FORWARD;
475 s->mb_intra=0; 475 s->mb_intra=0;
476 s->mv_type = MV_TYPE_16X16; 476 s->mv_type = MV_TYPE_16X16;
477 s->mb_skipped=0; 477 s->mb_skipped=0;
478 478
479 s->dsp.clear_blocks(s->block[0]); 479 s->dsp.clear_blocks(s->block[0]);
480 480
481 s->mb_x= mb_x; 481 s->mb_x= mb_x;
482 s->mb_y= mb_y; 482 s->mb_y= mb_y;
483 483
484 for(j=0; j<pred_count; j++){ 484 for(j=0; j<pred_count; j++){
580 580
581 if(s->pict_type==I_TYPE){ 581 if(s->pict_type==I_TYPE){
582 uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize; 582 uint8_t *mb_ptr = s->current_picture.data[0] + mb_x*16 + mb_y*16*s->linesize;
583 uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize; 583 uint8_t *last_mb_ptr= s->last_picture.data [0] + mb_x*16 + mb_y*16*s->linesize;
584 584
585 is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16); 585 is_intra_likely += s->dsp.sad[0](NULL, last_mb_ptr, mb_ptr , s->linesize, 16);
586 is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16); 586 is_intra_likely -= s->dsp.sad[0](NULL, last_mb_ptr, last_mb_ptr+s->linesize*16, s->linesize, 16);
587 }else{ 587 }else{
588 if(IS_INTRA(s->current_picture.mb_type[mb_xy])) 588 if(IS_INTRA(s->current_picture.mb_type[mb_xy]))
589 is_intra_likely++; 589 is_intra_likely++;
590 else 590 else
871 s->mv_type = MV_TYPE_16X16; 871 s->mv_type = MV_TYPE_16X16;
872 s->mv[0][0][0] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][0]; 872 s->mv[0][0][0] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][0];
873 s->mv[0][0][1] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][1]; 873 s->mv[0][0][1] = s->current_picture.motion_val[0][ mb_x*2 + mb_y*2*s->b8_stride ][1];
874 } 874 }
875 875
876 s->dsp.clear_blocks(s->block[0]); 876 s->dsp.clear_blocks(s->block[0]);
877 877
878 s->mb_x= mb_x; 878 s->mb_x= mb_x;
879 s->mb_y= mb_y; 879 s->mb_y= mb_y;
880 decode_mb(s); 880 decode_mb(s);
881 } 881 }