diff options
author | wm4 <nfxjfg@googlemail.com> | 2014-03-31 17:46:29 +0000 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2014-04-09 02:12:19 +0200 |
commit | f6774f905fb3cfdc319523ac640be30b14c1bc55 (patch) | |
tree | 6f0db53a2febce58c562d383e1f3f61c9c256275 /libavcodec/intrax8.c | |
parent | 60fd7d36c47d62d4c603bf16c213b1a924f5cfcf (diff) | |
download | ffmpeg-f6774f905fb3cfdc319523ac640be30b14c1bc55.tar.gz |
mpegvideo: operate with pointers to AVFrames instead of whole structs
The most interesting parts are initialization in ff_MPV_common_init() and
uninitialization in ff_MPV_common_end().
ff_mpeg_unref_picture and ff_thread_release_buffer have additional NULL
checks for Picture.f, because these functions can be called on
uninitialized or partially initialized Pictures.
NULL pointer checks are added to ff_thread_release_buffer() stub function.
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
Diffstat (limited to 'libavcodec/intrax8.c')
-rw-r--r-- | libavcodec/intrax8.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libavcodec/intrax8.c b/libavcodec/intrax8.c index 0cad9dab3c..962c4608da 100644 --- a/libavcodec/intrax8.c +++ b/libavcodec/intrax8.c @@ -306,7 +306,7 @@ static int x8_setup_spatial_predictor(IntraX8Context * const w, const int chroma int quant; w->dsp.setup_spatial_compensation(s->dest[chroma], s->edge_emu_buffer, - s->current_picture.f.linesize[chroma>0], + s->current_picture.f->linesize[chroma>0], &range, &sum, w->edges); if(chroma){ w->orient=w->chroma_orient; @@ -615,7 +615,7 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){ dc_level+= (w->predicted_dc*divide_quant + (1<<12) )>>13; dsp_x8_put_solidcolor( av_clip_uint8((dc_level*dc_quant+4)>>3), - s->dest[chroma], s->current_picture.f.linesize[!!chroma]); + s->dest[chroma], s->current_picture.f->linesize[!!chroma]); goto block_placed; } @@ -639,15 +639,15 @@ static int x8_decode_intra_mb(IntraX8Context* const w, const int chroma){ } if(w->flat_dc){ - dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f.linesize[!!chroma]); + dsp_x8_put_solidcolor(w->predicted_dc, s->dest[chroma], s->current_picture.f->linesize[!!chroma]); }else{ w->dsp.spatial_compensation[w->orient]( s->edge_emu_buffer, s->dest[chroma], - s->current_picture.f.linesize[!!chroma] ); + s->current_picture.f->linesize[!!chroma] ); } if(!zeros_only) s->dsp.idct_add ( s->dest[chroma], - s->current_picture.f.linesize[!!chroma], + s->current_picture.f->linesize[!!chroma], s->block[0] ); block_placed: @@ -658,7 +658,7 @@ block_placed: if(s->loop_filter){ uint8_t* ptr = s->dest[chroma]; - int linesize = s->current_picture.f.linesize[!!chroma]; + int linesize = s->current_picture.f->linesize[!!chroma]; if(!( (w->edges&2) || ( zeros_only && (w->orient|4)==4 ) )){ w->dsp.h_loop_filter(ptr, linesize, w->quant); @@ -673,12 +673,12 @@ block_placed: static void x8_init_block_index(MpegEncContext *s){ //FIXME maybe merge with ff_* //not s->linesize as this would be wrong for field pics //not that IntraX8 has interlacing support ;) - const int linesize = s->current_picture.f.linesize[0]; - const int uvlinesize = s->current_picture.f.linesize[1]; + const int linesize = s->current_picture.f->linesize[0]; + const int uvlinesize = s->current_picture.f->linesize[1]; - s->dest[0] = s->current_picture.f.data[0]; - s->dest[1] = s->current_picture.f.data[1]; - s->dest[2] = s->current_picture.f.data[2]; + s->dest[0] = s->current_picture.f->data[0]; + s->dest[1] = s->current_picture.f->data[1]; + s->dest[2] = s->current_picture.f->data[2]; s->dest[0] += s->mb_y * linesize << 3; s->dest[1] += ( s->mb_y&(~1) ) * uvlinesize << 2;//chroma blocks are on add rows |