On 2013-02-13 19:51:04 +0100, Anton Khirnov wrote:
> ---
> libavcodec/h263.c | 2 +-
> libavcodec/motion_est.c | 2 +-
> libavcodec/mpeg4videodec.c | 8 ++++----
> libavcodec/mpeg4videoenc.c | 2 +-
> libavcodec/mpegvideo.c | 4 ++--
> libavcodec/mpegvideo.h | 1 +
> 6 files changed, 10 insertions(+), 9 deletions(-)
>
> diff --git a/libavcodec/h263.c b/libavcodec/h263.c
> index 9a4973b..60c2527 100644
> --- a/libavcodec/h263.c
> +++ b/libavcodec/h263.c
> @@ -52,7 +52,7 @@ void ff_h263_update_motion_val(MpegEncContext * s){
> const int wrap = s->b8_stride;
> const int xy = s->block_index[0];
>
> - s->current_picture.f.mbskip_table[mb_xy] = s->mb_skipped;
> + s->current_picture.mbskip_table[mb_xy] = s->mb_skipped;
>
> if(s->mv_type != MV_TYPE_8X8){
> int motion_x, motion_y;
> diff --git a/libavcodec/motion_est.c b/libavcodec/motion_est.c
> index e051191..e275651 100644
> --- a/libavcodec/motion_est.c
> +++ b/libavcodec/motion_est.c
> @@ -1665,7 +1665,7 @@ void ff_estimate_b_frame_motion(MpegEncContext * s,
>
> c->skip=0;
>
> - if (s->codec_id == AV_CODEC_ID_MPEG4 &&
> s->next_picture.f.mbskip_table[xy]) {
> + if (s->codec_id == AV_CODEC_ID_MPEG4 &&
> s->next_picture.mbskip_table[xy]) {
> int score= direct_search(s, mb_x, mb_y); //FIXME just check 0,0
>
> score= ((unsigned)(score*score + 128*256))>>16;
> diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
> index 7922a61..fc0b145 100644
> --- a/libavcodec/mpeg4videodec.c
> +++ b/libavcodec/mpeg4videodec.c
> @@ -376,7 +376,7 @@ int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
> if(s->pict_type == AV_PICTURE_TYPE_B){
> int mb_x = 0, mb_y = 0;
>
> - while (s->next_picture.f.mbskip_table[s->mb_index2xy[mb_num]]) {
> + while (s->next_picture.mbskip_table[s->mb_index2xy[mb_num]]) {
> if (!mb_x)
> ff_thread_await_progress(&s->next_picture_ptr->f, mb_y++, 0);
> mb_num++;
> @@ -1293,7 +1293,7 @@ static int mpeg4_decode_mb(MpegEncContext *s,
> }
>
> /* if we skipped it in the future P Frame than skip it now too */
> - s->mb_skipped = s->next_picture.f.mbskip_table[s->mb_y *
> s->mb_stride + s->mb_x]; // Note, skiptab=0 if last was GMC
> + s->mb_skipped = s->next_picture.mbskip_table[s->mb_y * s->mb_stride
> + s->mb_x]; // Note, skiptab=0 if last was GMC
>
> if(s->mb_skipped){
> /* skip mb */
> @@ -1470,12 +1470,12 @@ end:
> if(mpeg4_is_resync(s)){
> const int delta= s->mb_x + 1 == s->mb_width ? 2 : 1;
>
> - if (s->pict_type == AV_PICTURE_TYPE_B &&
> s->next_picture.f.mbskip_table[xy + delta]) {
> + if (s->pict_type == AV_PICTURE_TYPE_B &&
> s->next_picture.mbskip_table[xy + delta]) {
> ff_thread_await_progress(&s->next_picture_ptr->f,
> (s->mb_x + delta >= s->mb_width) ?
> FFMIN(s->mb_y+1, s->mb_height-1) : s->mb_y, 0);
> }
>
> - if (s->pict_type == AV_PICTURE_TYPE_B &&
> s->next_picture.f.mbskip_table[xy + delta])
> + if (s->pict_type == AV_PICTURE_TYPE_B &&
> s->next_picture.mbskip_table[xy + delta])
> return SLICE_OK;
> return SLICE_END;
> }
> diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c
> index f925eb8..b346640 100644
> --- a/libavcodec/mpeg4videoenc.c
> +++ b/libavcodec/mpeg4videoenc.c
> @@ -499,7 +499,7 @@ void ff_mpeg4_encode_mb(MpegEncContext * s,
> assert(mb_type>=0);
>
> /* nothing to do if this MB was skipped in the next P Frame */
> - if (s->next_picture.f.mbskip_table[s->mb_y * s->mb_stride +
> s->mb_x]) { //FIXME avoid DCT & ...
> + if (s->next_picture.mbskip_table[s->mb_y * s->mb_stride +
> s->mb_x]) { //FIXME avoid DCT & ...
> s->skip_count++;
> s->mv[0][0][0]=
> s->mv[0][0][1]=
> diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
> index 48d007c..2448f30 100644
> --- a/libavcodec/mpegvideo.c
> +++ b/libavcodec/mpegvideo.c
> @@ -395,7 +395,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int
> shared)
> mb_array_size * sizeof(int8_t ), fail)
> }
>
> - FF_ALLOCZ_OR_GOTO(s->avctx, pic->f.mbskip_table,
> + FF_ALLOCZ_OR_GOTO(s->avctx, pic->mbskip_table,
> mb_array_size * sizeof(uint8_t) + 2, fail)// the +
> 2 is for the slice end check
> FF_ALLOCZ_OR_GOTO(s->avctx, pic->qscale_table_base,
> (big_mb_num + s->mb_stride) * sizeof(uint8_t),
> @@ -459,7 +459,7 @@ static void free_picture(MpegEncContext *s, Picture *pic)
> av_freep(&pic->mb_var);
> av_freep(&pic->mc_mb_var);
> av_freep(&pic->mb_mean);
> - av_freep(&pic->f.mbskip_table);
> + av_freep(&pic->mbskip_table);
> av_freep(&pic->qscale_table_base);
> pic->qscale_table = NULL;
> av_freep(&pic->mb_type_base);
> diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h
> index 48c2bf1..df8b1a1 100644
> --- a/libavcodec/mpegvideo.h
> +++ b/libavcodec/mpegvideo.h
> @@ -151,6 +151,7 @@ typedef struct Picture{
> int reference;
>
> int8_t *qscale_table;
> + uint8_t *mbskip_table;
> } Picture;
>
> /**
ok
Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel