Mercurial > libavcodec.hg
comparison h264.c @ 7498:e7006afcb1c6 libavcodec
Use local variabes for *stride, where local variables exist.
author | michael |
---|---|
date | Tue, 05 Aug 2008 12:06:30 +0000 |
parents | 9dbaea2302fd |
children | 4017c5ba7bab |
comparison
equal
deleted
inserted
replaced
7497:9dbaea2302fd | 7498:e7006afcb1c6 |
---|---|
1131 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); | 1131 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mv[1][0],mv[1][1]), 4); |
1132 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); | 1132 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[0], 1); |
1133 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); | 1133 fill_rectangle(&h->ref_cache[1][scan8[i8*4]], 2, 2, 8, (uint8_t)ref[1], 1); |
1134 | 1134 |
1135 /* col_zero_flag */ | 1135 /* col_zero_flag */ |
1136 if(!IS_INTRA(mb_type_col[0]) && ( l1ref0[x8 + y8*h->b8_stride] == 0 | 1136 if(!IS_INTRA(mb_type_col[0]) && ( l1ref0[x8 + y8*b8_stride] == 0 |
1137 || (l1ref0[x8 + y8*h->b8_stride] < 0 && l1ref1[x8 + y8*h->b8_stride] == 0 | 1137 || (l1ref0[x8 + y8*b8_stride] < 0 && l1ref1[x8 + y8*b8_stride] == 0 |
1138 && (h->x264_build>33 || !h->x264_build)))){ | 1138 && (h->x264_build>33 || !h->x264_build)))){ |
1139 const int16_t (*l1mv)[2]= l1ref0[x8 + y8*h->b8_stride] == 0 ? l1mv0 : l1mv1; | 1139 const int16_t (*l1mv)[2]= l1ref0[x8 + y8*b8_stride] == 0 ? l1mv0 : l1mv1; |
1140 if(IS_SUB_8X8(sub_mb_type)){ | 1140 if(IS_SUB_8X8(sub_mb_type)){ |
1141 const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; | 1141 const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride]; |
1142 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ | 1142 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ |
1143 if(ref[0] == 0) | 1143 if(ref[0] == 0) |
1144 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); | 1144 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); |
1145 if(ref[1] == 0) | 1145 if(ref[1] == 0) |
1146 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); | 1146 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); |
1147 } | 1147 } |
1148 }else | 1148 }else |
1149 for(i4=0; i4<4; i4++){ | 1149 for(i4=0; i4<4; i4++){ |
1150 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; | 1150 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; |
1151 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ | 1151 if(FFABS(mv_col[0]) <= 1 && FFABS(mv_col[1]) <= 1){ |
1152 if(ref[0] == 0) | 1152 if(ref[0] == 0) |
1153 *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; | 1153 *(uint32_t*)h->mv_cache[0][scan8[i8*4+i4]] = 0; |
1154 if(ref[1] == 0) | 1154 if(ref[1] == 0) |
1155 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; | 1155 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = 0; |
1251 fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); | 1251 fill_rectangle(&h-> mv_cache[0][scan8[i8*4]], 2, 2, 8, 0, 4); |
1252 fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); | 1252 fill_rectangle(&h-> mv_cache[1][scan8[i8*4]], 2, 2, 8, 0, 4); |
1253 continue; | 1253 continue; |
1254 } | 1254 } |
1255 | 1255 |
1256 ref0 = l1ref0[x8 + y8*h->b8_stride]; | 1256 ref0 = l1ref0[x8 + y8*b8_stride]; |
1257 if(ref0 >= 0) | 1257 if(ref0 >= 0) |
1258 ref0 = map_col_to_list0[0][ref0]; | 1258 ref0 = map_col_to_list0[0][ref0]; |
1259 else{ | 1259 else{ |
1260 ref0 = map_col_to_list0[1][l1ref1[x8 + y8*h->b8_stride]]; | 1260 ref0 = map_col_to_list0[1][l1ref1[x8 + y8*b8_stride]]; |
1261 l1mv= l1mv1; | 1261 l1mv= l1mv1; |
1262 } | 1262 } |
1263 scale = dist_scale_factor[ref0]; | 1263 scale = dist_scale_factor[ref0]; |
1264 | 1264 |
1265 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); | 1265 fill_rectangle(&h->ref_cache[0][scan8[i8*4]], 2, 2, 8, ref0, 1); |
1266 if(IS_SUB_8X8(sub_mb_type)){ | 1266 if(IS_SUB_8X8(sub_mb_type)){ |
1267 const int16_t *mv_col = l1mv[x8*3 + y8*3*h->b_stride]; | 1267 const int16_t *mv_col = l1mv[x8*3 + y8*3*b4_stride]; |
1268 int mx = (scale * mv_col[0] + 128) >> 8; | 1268 int mx = (scale * mv_col[0] + 128) >> 8; |
1269 int my = (scale * mv_col[1] + 128) >> 8; | 1269 int my = (scale * mv_col[1] + 128) >> 8; |
1270 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); | 1270 fill_rectangle(&h->mv_cache[0][scan8[i8*4]], 2, 2, 8, pack16to32(mx,my), 4); |
1271 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); | 1271 fill_rectangle(&h->mv_cache[1][scan8[i8*4]], 2, 2, 8, pack16to32(mx-mv_col[0],my-mv_col[1]), 4); |
1272 }else | 1272 }else |
1273 for(i4=0; i4<4; i4++){ | 1273 for(i4=0; i4<4; i4++){ |
1274 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*h->b_stride]; | 1274 const int16_t *mv_col = l1mv[x8*2 + (i4&1) + (y8*2 + (i4>>1))*b4_stride]; |
1275 int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; | 1275 int16_t *mv_l0 = h->mv_cache[0][scan8[i8*4+i4]]; |
1276 mv_l0[0] = (scale * mv_col[0] + 128) >> 8; | 1276 mv_l0[0] = (scale * mv_col[0] + 128) >> 8; |
1277 mv_l0[1] = (scale * mv_col[1] + 128) >> 8; | 1277 mv_l0[1] = (scale * mv_col[1] + 128) >> 8; |
1278 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = | 1278 *(uint32_t*)h->mv_cache[1][scan8[i8*4+i4]] = |
1279 pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); | 1279 pack16to32(mv_l0[0]-mv_col[0],mv_l0[1]-mv_col[1]); |