Mercurial > libavcodec.hg
comparison mpegvideo.c @ 279:ae5c33165d5c libavcodec
mpeg1 & epzs fix
author | michaelni |
---|---|
date | Fri, 22 Mar 2002 04:35:46 +0000 |
parents | 5cb2978e701f |
children | 3dc1ca4ba717 |
comparison
equal
deleted
inserted
replaced
278:6a5293bc8089 | 279:ae5c33165d5c |
---|---|
172 perror("malloc"); | 172 perror("malloc"); |
173 goto fail; | 173 goto fail; |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 if (s->out_format == FMT_H263) { | 177 if (s->out_format == FMT_H263 || s->encoding) { |
178 int size; | 178 int size; |
179 /* MV prediction */ | 179 /* MV prediction */ |
180 size = (2 * s->mb_width + 2) * (2 * s->mb_height + 2); | 180 size = (2 * s->mb_width + 2) * (2 * s->mb_height + 2); |
181 s->motion_val = malloc(size * 2 * sizeof(INT16)); | 181 s->motion_val = malloc(size * 2 * sizeof(INT16)); |
182 if (s->motion_val == NULL) | 182 if (s->motion_val == NULL) |
959 } | 959 } |
960 } | 960 } |
961 else if (s->h263_pred || s->h263_aic) | 961 else if (s->h263_pred || s->h263_aic) |
962 s->mbintra_table[mb_x + mb_y*s->mb_width]=1; | 962 s->mbintra_table[mb_x + mb_y*s->mb_width]=1; |
963 | 963 |
964 /* update motion predictor, not for B-frames as they need the motion_val from the last P/S-Frame */ | 964 /* update motion predictor, not for B-frames as they need the motion_val from the last P/S-Frame |
965 if (s->out_format == FMT_H263) { | 965 motion_val is needed for encodig too, as the ME needs it */ |
966 if (s->out_format == FMT_H263 || s->encoding) { | |
966 if(s->pict_type!=B_TYPE){ | 967 if(s->pict_type!=B_TYPE){ |
967 int xy, wrap, motion_x, motion_y; | 968 int xy, wrap, motion_x, motion_y; |
968 | 969 |
969 wrap = 2 * s->mb_width + 2; | 970 wrap = 2 * s->mb_width + 2; |
970 xy = 2 * mb_x + 1 + (2 * mb_y + 1) * wrap; | 971 xy = 2 * mb_x + 1 + (2 * mb_y + 1) * wrap; |