1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-02-14 22:22:59 +02:00

er: replace VLA with malloc/free

(cherry picked from commit 5c2d016a85453f121285d125ed049a8cf492855a)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Mans Rullgard 2010-07-04 01:57:47 +01:00 committed by Michael Niedermayer
parent 364f367921
commit 39b0165f9e

View File

@ -358,7 +358,7 @@ static void v_block_filter(MpegEncContext *s, uint8_t *dst, int w, int h, int st
} }
static void guess_mv(MpegEncContext *s){ static void guess_mv(MpegEncContext *s){
uint8_t fixed[s->mb_stride * s->mb_height]; uint8_t *fixed = av_malloc(s->mb_stride * s->mb_height);
#define MV_FROZEN 3 #define MV_FROZEN 3
#define MV_CHANGED 2 #define MV_CHANGED 2
#define MV_UNCHANGED 1 #define MV_UNCHANGED 1
@ -414,7 +414,7 @@ static void guess_mv(MpegEncContext *s){
decode_mb(s, 0); decode_mb(s, 0);
} }
} }
return; goto end;
} }
for(depth=0;; depth++){ for(depth=0;; depth++){
@ -634,7 +634,7 @@ score_sum+= best_score;
} }
if(none_left) if(none_left)
return; goto end;
for(i=0; i<s->mb_num; i++){ for(i=0; i<s->mb_num; i++){
int mb_xy= s->mb_index2xy[i]; int mb_xy= s->mb_index2xy[i];
@ -643,6 +643,8 @@ score_sum+= best_score;
} }
// printf(":"); fflush(stdout); // printf(":"); fflush(stdout);
} }
end:
av_free(fixed);
} }
static int is_intra_more_likely(MpegEncContext *s){ static int is_intra_more_likely(MpegEncContext *s){