comparison h264_direct.c @ 11078:e1eb8879e368 libavcodec

Long term references behave different from short term in spatial direct MV calculation. Fixes FRExt_MMCO4_Sony_B / issue1251
author michael
date Sat, 06 Feb 2010 02:55:58 +0000
parents b847f02d5b03
children a270b4c67089
comparison
equal deleted inserted replaced
11077:c5f2e2abb70e 11078:e1eb8879e368
261 continue; 261 continue;
262 h->sub_mb_type[i8] = sub_mb_type; 262 h->sub_mb_type[i8] = sub_mb_type;
263 263
264 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); 264 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
265 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); 265 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
266 if(!IS_INTRA(mb_type_col[y8]) 266 if(!IS_INTRA(mb_type_col[y8]) && !h->ref_list[1][0].long_ref
267 && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1) 267 && ( (l1ref0[xy8] == 0 && FFABS(l1mv0[xy4][0]) <= 1 && FFABS(l1mv0[xy4][1]) <= 1)
268 || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){ 268 || (l1ref0[xy8] < 0 && l1ref1[xy8] == 0 && FFABS(l1mv1[xy4][0]) <= 1 && FFABS(l1mv1[xy4][1]) <= 1))){
269 if(ref[0] > 0) 269 if(ref[0] > 0)
270 a= pack16to32(mv[0][0],mv[0][1]); 270 a= pack16to32(mv[0][0],mv[0][1]);
271 if(ref[1] > 0) 271 if(ref[1] > 0)
280 }else if(IS_16X16(*mb_type)){ 280 }else if(IS_16X16(*mb_type)){
281 int a=0, b=0; 281 int a=0, b=0;
282 282
283 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1); 283 fill_rectangle(&h->ref_cache[0][scan8[0]], 4, 4, 8, (uint8_t)ref[0], 1);
284 fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1); 284 fill_rectangle(&h->ref_cache[1][scan8[0]], 4, 4, 8, (uint8_t)ref[1], 1);
285 if(!IS_INTRA(mb_type_col[0]) 285 if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref
286 && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1) 286 && ( (l1ref0[0] == 0 && FFABS(l1mv0[0][0]) <= 1 && FFABS(l1mv0[0][1]) <= 1)
287 || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1 287 || (l1ref0[0] < 0 && l1ref1[0] == 0 && FFABS(l1mv1[0][0]) <= 1 && FFABS(l1mv1[0][1]) <= 1
288 && (h->x264_build>33 || !h->x264_build)))){ 288 && (h->x264_build>33 || !h->x264_build)))){
289 if(ref[0] > 0) 289 if(ref[0] > 0)
290 a= pack16to32(mv[0][0],mv[0][1]); 290 a= pack16to32(mv[0][0],mv[0][1]);
309 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); 309 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4);
310 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); 310 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1);
311 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); 311 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1);
312 312
313 /* col_zero_flag */ 313 /* col_zero_flag */
314 if(!IS_INTRA(mb_type_col[0]) && ( l1ref0[x8 + y8*b8_stride] == 0 314 if(!IS_INTRA(mb_type_col[0]) && !h->ref_list[1][0].long_ref && ( l1ref0[x8 + y8*b8_stride] == 0
315 || (l1ref0[x8 + y8*b8_stride] < 0 && l1ref1[x8 + y8*b8_stride] == 0 315 || (l1ref0[x8 + y8*b8_stride] < 0 && l1ref1[x8 + y8*b8_stride] == 0
316 && (h->x264_build>33 || !h->x264_build)))){ 316 && (h->x264_build>33 || !h->x264_build)))){
317 const int16_t (*l1mv)[2]= l1ref0[x8 + y8*b8_stride] == 0 ? l1mv0 : l1mv1; 317 const int16_t (*l1mv)[2]= l1ref0[x8 + y8*b8_stride] == 0 ? l1mv0 : l1mv1;
318 if(IS_SUB_8X8(sub_mb_type)){ 318 if(IS_SUB_8X8(sub_mb_type)){
319 const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride]; 319 const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride];