• Andreas Rheinhardt's avatar
    avcodec/hevc_cabac: Let compiler count offsets · c1cdaef5
    Andreas Rheinhardt authored
    This is easily possible with an X macro.
    Using an enum for the offsets also allows to remove
    two arrays which are not really needed and will typically
    be optimized away by the compiler: The first just exists
    to count the number of syntax elements*, the second one
    exists to get offset[CONSTANT]. These constants were
    of type enum SyntaxElement and this enum was only used
    in hevc_cabac.c (although it was declared in hevcdec.h);
    it is now no longer needed at all and has therefore been
    removed.
    
    The first of these arrays led to a warning from Clang
    which is fixed by this commit:
    warning: variable 'num_bins_in_se' is not needed and will
    not be emitted [-Wunneeded-internal-declaration]
    
    *: One could also just added a trailing SYNTAX_ELEMENT_NB
    to the SyntaxElement enum for this purpose.
    Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@outlook.com>
    c1cdaef5
hevc_cabac.c 49.9 KB