[FFmpeg-devel] [PATCH 5/5] avcodec/vc1: store zero MVs for all blocks in a MB

Michael Niedermayer michael at niedermayer.cc
Sun May 20 03:13:56 EEST 2018


On Sat, May 19, 2018 at 08:23:59PM -0300, James Almer wrote:
> On 5/19/2018 6:40 PM, Michael Niedermayer wrote:
> > On Fri, May 18, 2018 at 05:06:36PM +0200, Jerome Borsboom wrote:
> >> Direct prediction for interlace frame B pictures references the mv in the
> >> second block in an MB in the backward reference frame for the twomv case.
> >> When the backward reference frame is an I frame, this value may be unset.
> >>
> >> Signed-off-by: Jerome Borsboom <jerome.borsboom at carpalis.nl>
> >> ---
> >>  libavcodec/vc1_block.c | 6 ++++--
> >>  1 file changed, 4 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/libavcodec/vc1_block.c b/libavcodec/vc1_block.c
> >> index 74935ec9e9..9c170a1e3c 100644
> >> --- a/libavcodec/vc1_block.c
> >> +++ b/libavcodec/vc1_block.c
> >> @@ -2678,8 +2678,10 @@ static void vc1_decode_i_blocks_adv(VC1Context *v)
> >>              s->bdsp.clear_blocks(block[0]);
> >>              mb_pos = s->mb_x + s->mb_y * s->mb_stride;
> >>              s->current_picture.mb_type[mb_pos + v->mb_off]                         = MB_TYPE_INTRA;
> >> -            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][0] = 0;
> >> -            s->current_picture.motion_val[1][s->block_index[0] + v->blocks_off][1] = 0;
> >> +            for (int i = 0; i < 4; i++) {
> >> +                s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][0] = 0;
> >> +                s->current_picture.motion_val[1][s->block_index[i] + v->blocks_off][1] = 0;
> >> +            }
> > 
> > see AV_ZERO*
> 
> Those may use mmx instructions, which may require calling emms_c() after
> the loop.
> memset() may be a better choice here. For a small amount of bytes the
> compiler should be able to optimize it into an inlined mov/xor on its own.

This calls clear_blocks() a few lines before which can use mmx too unless iam
missing something


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Why not whip the teacher when the pupil misbehaves? -- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20180520/d72822e1/attachment.sig>


More information about the ffmpeg-devel mailing list