ericmckean / webm

Automatically exported from code.google.com/p/webm
0 stars 0 forks source link

Need test vector: #662

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
If you attempt to optimize the following code: 

#define IF_DIFF_REF_FRAME_ADD_MV(CANDIDATE) \
  do { \
    if ((CANDIDATE)->ref_frame[0] != ref_frame) \
      ADD_MV_REF_LIST(scale_mv((CANDIDATE), 0, ref_frame, ref_sign_bias)); \
    if ((CANDIDATE)->ref_frame[1] != ref_frame && \
        has_second_ref(CANDIDATE) && \
        (CANDIDATE)->mv[1].as_int != (CANDIDATE)->mv[0].as_int) \
      ADD_MV_REF_LIST(scale_mv((CANDIDATE), 1, ref_frame, ref_sign_bias)); \
  } while (0)

By skipping the double check on the mv ( its checked again in add_mv_ref_list) 
as follows: 

#define IF_DIFF_REF_FRAME_ADD_MV(CANDIDATE) \
  do { \
    if ((CANDIDATE)->ref_frame[0] != ref_frame) \
      ADD_MV_REF_LIST(scale_mv((CANDIDATE), 0, ref_frame, ref_sign_bias)); \
    if ((CANDIDATE)->ref_frame[1] != ref_frame && \
        has_second_ref(CANDIDATE)) \
      ADD_MV_REF_LIST(scale_mv((CANDIDATE), 1, ref_frame, ref_sign_bias)); \
  } while (0)

You actually change the bitstream. The reason is that this check checks that 
the mv is not the same in both directions before scaling ( which might flip one 
of the mv signs).

This change passes all of our current test vectors but is a bug as reported 
here: 

https://lists.ffmpeg.org/pipermail/ffmpeg-devel/2013-November/150777.html

We need a test vector that shows that this is a bug so that no one else sees 
the issue.  

Original issue reported on code.google.com by jimbankoski@google.com on 12 Nov 2013 at 1:52