On Sun, Apr 07, 2019 at 10:00:09AM +0200, Paul B Mahol wrote: > On 4/7/19, Peter Ross <[email protected]> wrote: > > On Wed, Mar 27, 2019 at 09:21:47PM +0100, Paul B Mahol wrote: > >> Signed-off-by: Paul B Mahol <[email protected]> > >> --- > >> Missing deblocking. > >> --- > >> configure | 1 + > >> libavcodec/Makefile | 1 + > >> libavcodec/allcodecs.c | 1 + > >> libavcodec/avcodec.h | 1 + > >> libavcodec/bink2.c | 787 +++++++++++++++++++++++ > >> libavcodec/bink2f.c | 1139 +++++++++++++++++++++++++++++++++ > >> libavcodec/bink2g.c | 1342 +++++++++++++++++++++++++++++++++++++++
> >> +static int bink2g_get_type(GetBitContext *gb, int *lru)
> >> +{
> >> + int val;
> >> +
> >> + ff_dlog(NULL, " type show %X @ %d\n", show_bits(gb, 4),
> >> get_bits_count(gb));
> >> + switch (get_unary(gb, 1, 3)) {
> >> + case 0:
> >> + val = lru[0];
> >> + break;
> >> + case 1:
> >> + val = lru[1];
> >> + FFSWAP(int, lru[0], lru[1]);
> >> + break;
> >> + case 2:
> >> + val = lru[3];
> >> + FFSWAP(int, lru[2], lru[3]);
> >> + break;
> >> + case 3:
> >> + val = lru[2];
> >> + FFSWAP(int, lru[1], lru[2]);
> >> + break;
> >> + }
> >
> > cases 1-3 could be collapsed.
>
> I do not see how.
reorder the second and third elements in bink2g_decode_slice types_lru[].
that at least removes the val = lru[x] statement from each switch case.
as for the swaps, there is some (probably unintentional) symetry going on there.
the result could be:
int n = get_unary(gb, 1, 3)
int v = lru[n];
if (n) {
int n2 = n == 1 ? 1 : 3;
FFSWAP(int, lru[n - 1], lru[n2]);
}
return v;
this is a minor cleanup and in the scheme of things, may not even be worth it.
-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
