Mercurial > libavcodec.hg
comparison vp56.c @ 3697:596e62da8f29 libavcodec
rename vector to vect to avoid clash with Apple gcc
author | aurel |
---|---|
date | Sat, 09 Sep 2006 22:53:44 +0000 |
parents | 6795c9e5f983 |
children | fb73a0142544 |
comparison
equal
deleted
inserted
replaced
3696:e2aafe2aa2df | 3697:596e62da8f29 |
---|---|
34 | 34 |
35 static int vp56_get_vectors_predictors(vp56_context_t *s, int row, int col, | 35 static int vp56_get_vectors_predictors(vp56_context_t *s, int row, int col, |
36 vp56_frame_t ref_frame) | 36 vp56_frame_t ref_frame) |
37 { | 37 { |
38 int nb_pred = 0; | 38 int nb_pred = 0; |
39 vp56_mv_t vector[2] = {{0,0}, {0,0}}; | 39 vp56_mv_t vect[2] = {{0,0}, {0,0}}; |
40 int pos, offset; | 40 int pos, offset; |
41 vp56_mv_t mvp; | 41 vp56_mv_t mvp; |
42 | 42 |
43 for (pos=0; pos<12; pos++) { | 43 for (pos=0; pos<12; pos++) { |
44 mvp.x = col + vp56_candidate_predictor_pos[pos][0]; | 44 mvp.x = col + vp56_candidate_predictor_pos[pos][0]; |
48 continue; | 48 continue; |
49 offset = mvp.x + s->mb_width*mvp.y; | 49 offset = mvp.x + s->mb_width*mvp.y; |
50 | 50 |
51 if (vp56_reference_frame[s->macroblocks[offset].type] != ref_frame) | 51 if (vp56_reference_frame[s->macroblocks[offset].type] != ref_frame) |
52 continue; | 52 continue; |
53 if ((s->macroblocks[offset].mv.x == vector[0].x && | 53 if ((s->macroblocks[offset].mv.x == vect[0].x && |
54 s->macroblocks[offset].mv.y == vector[0].y) || | 54 s->macroblocks[offset].mv.y == vect[0].y) || |
55 (s->macroblocks[offset].mv.x == 0 && | 55 (s->macroblocks[offset].mv.x == 0 && |
56 s->macroblocks[offset].mv.y == 0)) | 56 s->macroblocks[offset].mv.y == 0)) |
57 continue; | 57 continue; |
58 | 58 |
59 vector[nb_pred++] = s->macroblocks[offset].mv; | 59 vect[nb_pred++] = s->macroblocks[offset].mv; |
60 if (nb_pred > 1) { | 60 if (nb_pred > 1) { |
61 nb_pred = -1; | 61 nb_pred = -1; |
62 break; | 62 break; |
63 } | 63 } |
64 s->vector_candidate_pos = pos; | 64 s->vector_candidate_pos = pos; |
65 } | 65 } |
66 | 66 |
67 s->vector_candidate[0] = vector[0]; | 67 s->vector_candidate[0] = vect[0]; |
68 s->vector_candidate[1] = vector[1]; | 68 s->vector_candidate[1] = vect[1]; |
69 | 69 |
70 return nb_pred+1; | 70 return nb_pred+1; |
71 } | 71 } |
72 | 72 |
73 static void vp56_parse_mb_type_models(vp56_context_t *s) | 73 static void vp56_parse_mb_type_models(vp56_context_t *s) |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 static vp56_mb_t vp56_decode_mv(vp56_context_t *s, int row, int col) | 199 static vp56_mb_t vp56_decode_mv(vp56_context_t *s, int row, int col) |
200 { | 200 { |
201 vp56_mv_t *mv, vector = {0,0}; | 201 vp56_mv_t *mv, vect = {0,0}; |
202 int ctx, b; | 202 int ctx, b; |
203 | 203 |
204 ctx = vp56_get_vectors_predictors(s, row, col, VP56_FRAME_PREVIOUS); | 204 ctx = vp56_get_vectors_predictors(s, row, col, VP56_FRAME_PREVIOUS); |
205 s->mb_type = vp56_parse_mb_type(s, s->mb_type, ctx); | 205 s->mb_type = vp56_parse_mb_type(s, s->mb_type, ctx); |
206 s->macroblocks[row * s->mb_width + col].type = s->mb_type; | 206 s->macroblocks[row * s->mb_width + col].type = s->mb_type; |
223 vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN); | 223 vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN); |
224 mv = &s->vector_candidate[1]; | 224 mv = &s->vector_candidate[1]; |
225 break; | 225 break; |
226 | 226 |
227 case VP56_MB_INTER_DELTA_PF: | 227 case VP56_MB_INTER_DELTA_PF: |
228 s->parse_vector_adjustment(s, &vector); | 228 s->parse_vector_adjustment(s, &vect); |
229 mv = &vector; | 229 mv = &vect; |
230 break; | 230 break; |
231 | 231 |
232 case VP56_MB_INTER_DELTA_GF: | 232 case VP56_MB_INTER_DELTA_GF: |
233 vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN); | 233 vp56_get_vectors_predictors(s, row, col, VP56_FRAME_GOLDEN); |
234 s->parse_vector_adjustment(s, &vector); | 234 s->parse_vector_adjustment(s, &vect); |
235 mv = &vector; | 235 mv = &vect; |
236 break; | 236 break; |
237 | 237 |
238 case VP56_MB_INTER_4V: | 238 case VP56_MB_INTER_4V: |
239 vp56_decode_4mv(s, row, col); | 239 vp56_decode_4mv(s, row, col); |
240 return s->mb_type; | 240 return s->mb_type; |
241 | 241 |
242 default: | 242 default: |
243 mv = &vector; | 243 mv = &vect; |
244 break; | 244 break; |
245 } | 245 } |
246 | 246 |
247 s->macroblocks[row*s->mb_width + col].mv = *mv; | 247 s->macroblocks[row*s->mb_width + col].mv = *mv; |
248 | 248 |