|
|
@ -394,7 +394,7 @@ mca( 8, 8,8) |
|
|
|
av_cold int ff_snow_common_init(AVCodecContext *avctx){ |
|
|
|
av_cold int ff_snow_common_init(AVCodecContext *avctx){ |
|
|
|
SnowContext *s = avctx->priv_data; |
|
|
|
SnowContext *s = avctx->priv_data; |
|
|
|
int width, height; |
|
|
|
int width, height; |
|
|
|
int i, j; |
|
|
|
int i, j, ret; |
|
|
|
|
|
|
|
|
|
|
|
s->avctx= avctx; |
|
|
|
s->avctx= avctx; |
|
|
|
s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe
|
|
|
|
s->max_ref_frames=1; //just make sure its not an invalid value in case of no initial keyframe
|
|
|
@ -447,19 +447,24 @@ av_cold int ff_snow_common_init(AVCodecContext *avctx){ |
|
|
|
width= s->avctx->width; |
|
|
|
width= s->avctx->width; |
|
|
|
height= s->avctx->height; |
|
|
|
height= s->avctx->height; |
|
|
|
|
|
|
|
|
|
|
|
s->spatial_idwt_buffer= av_mallocz(width*height*sizeof(IDWTELEM)); |
|
|
|
FF_ALLOCZ_OR_GOTO(avctx, s->spatial_idwt_buffer, width * height * sizeof(IDWTELEM), fail); |
|
|
|
s->spatial_dwt_buffer= av_mallocz(width*height*sizeof(DWTELEM)); //FIXME this does not belong here
|
|
|
|
FF_ALLOCZ_OR_GOTO(avctx, s->spatial_dwt_buffer, width * height * sizeof(DWTELEM), fail); //FIXME this does not belong here
|
|
|
|
s->temp_dwt_buffer = av_mallocz(width * sizeof(DWTELEM)); |
|
|
|
FF_ALLOCZ_OR_GOTO(avctx, s->temp_dwt_buffer, width * sizeof(DWTELEM), fail); |
|
|
|
s->temp_idwt_buffer = av_mallocz(width * sizeof(IDWTELEM)); |
|
|
|
FF_ALLOCZ_OR_GOTO(avctx, s->temp_idwt_buffer, width * sizeof(IDWTELEM), fail); |
|
|
|
|
|
|
|
|
|
|
|
for(i=0; i<MAX_REF_FRAMES; i++) |
|
|
|
for(i=0; i<MAX_REF_FRAMES; i++) |
|
|
|
for(j=0; j<MAX_REF_FRAMES; j++) |
|
|
|
for(j=0; j<MAX_REF_FRAMES; j++) |
|
|
|
ff_scale_mv_ref[i][j] = 256*(i+1)/(j+1); |
|
|
|
ff_scale_mv_ref[i][j] = 256*(i+1)/(j+1); |
|
|
|
|
|
|
|
|
|
|
|
s->avctx->get_buffer(s->avctx, &s->mconly_picture); |
|
|
|
if ((ret = s->avctx->get_buffer(s->avctx, &s->mconly_picture)) < 0) { |
|
|
|
s->scratchbuf = av_malloc(s->mconly_picture.linesize[0]*7*MB_SIZE); |
|
|
|
av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n"); |
|
|
|
|
|
|
|
return ret; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
FF_ALLOC_OR_GOTO(avctx, s->scratchbuf, s->mconly_picture.linesize[0]*7*MB_SIZE, fail); |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
|
|
|
|
fail: |
|
|
|
|
|
|
|
return AVERROR(ENOMEM); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int ff_snow_common_init_after_header(AVCodecContext *avctx) { |
|
|
|
int ff_snow_common_init_after_header(AVCodecContext *avctx) { |
|
|
|