comparison mpegvideo.c @ 11292:411ab09ada91 libavcodec

Get rid of mb2b8_xy and b8_stride, change arrays organized based on b8_stride to ones based on mb_stride in h264. about 20 cpu cycles faster overall per MB
author michael
date Thu, 25 Feb 2010 23:44:42 +0000
parents ea8f891d997d
children 421c9441c11e
comparison
equal deleted inserted replaced
11291:1527e25ec9d4 11292:411ab09ada91
255 pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1; 255 pic->mb_type= pic->mb_type_base + 2*s->mb_stride+1;
256 if(s->out_format == FMT_H264){ 256 if(s->out_format == FMT_H264){
257 for(i=0; i<2; i++){ 257 for(i=0; i<2; i++){
258 FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t), fail) 258 FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b4_array_size+4) * sizeof(int16_t), fail)
259 pic->motion_val[i]= pic->motion_val_base[i]+4; 259 pic->motion_val[i]= pic->motion_val_base[i]+4;
260 FF_ALLOCZ_OR_GOTO(s->avctx, pic->ref_index[i], b8_array_size * sizeof(uint8_t), fail) 260 FF_ALLOCZ_OR_GOTO(s->avctx, pic->ref_index[i], 4*mb_array_size * sizeof(uint8_t), fail)
261 } 261 }
262 pic->motion_subsample_log2= 2; 262 pic->motion_subsample_log2= 2;
263 }else if(s->out_format == FMT_H263 || s->encoding || (s->avctx->debug&FF_DEBUG_MV) || (s->avctx->debug_mv)){ 263 }else if(s->out_format == FMT_H263 || s->encoding || (s->avctx->debug&FF_DEBUG_MV) || (s->avctx->debug_mv)){
264 for(i=0; i<2; i++){ 264 for(i=0; i<2; i++){
265 FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b8_array_size+4) * sizeof(int16_t), fail) 265 FF_ALLOCZ_OR_GOTO(s->avctx, pic->motion_val_base[i], 2 * (b8_array_size+4) * sizeof(int16_t), fail)