]> git.sesse.net Git - ffmpeg/commit
avcodec/magicyuv: Don't invert order unnecessarily
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 23 Sep 2020 12:19:03 +0000 (14:19 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sat, 26 Sep 2020 18:38:30 +0000 (20:38 +0200)
commit68b6614e389955016a77ff182f0a8bb03d41ae52
tree1a661ee872d672fc081e2b6e4bfc61bfbe906637
parent157953066ccd8cdaeecbf17ad694a82a8dd22145
avcodec/magicyuv: Don't invert order unnecessarily

The MagicYUV decoder currently sets both the length and the symbol field
of an array of HuffEntries; hereby the symbol of the ith entry (0-based)
is just i. Then said array gets sorted so that entries with greater
length are at the end and entries with the same length are ordered so
that those with smaller symbols are at the end. Afterwards the newly
sorted array is traversed in reverse order. This commit instead inverts
the ordering and traverses the array in its ordinary order in order to
simplify understanding.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/magicyuv.c