• Andreas Rheinhardt's avatar
    avcodec/h261enc: Fix ac_vlc_length tables · 3a5202d0
    Andreas Rheinhardt authored
    These tables are supposed to contain the number of bits needed
    to encode a given (run, level) pair. Yet the number of bits
    for pairs needing the escape code was wrong (it only contained
    the escape code and not the bits needed for run and level).
    
    Furthermore, H.261 (a format with explicit end-of-block codes)
    does not work well together with the RLTable API from rl.c:
    The EOB code is the first one in ff_h261_rl_tcoeff's VLC table
    and has a run value of zero. Therefore the result of get_rl_index()
    is off by one for run == 0 and level values with explicit
    (run, level) pair.
    
    Fixing this necessitated changing the ref files of the
    vsynth*-h261-trellis tests. Both filesizes as well as PSNR
    decreased. If one used a qscale value of 11 for this test,
    one would have received files with about the same size as
    before this patch (with qscale 12), but with better PSNR.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    3a5202d0
vsynth2-h261-trellis 275 Bytes