> +#define UNQUANT(val, q) ((q * val + 0x80) >> 8)
I'd call this DEQUANT, but that's just me.
> + for (i = 0; i < 4; i++) {
> + if (i & 1) {
> + t0 = UNQUANT(q[1], in[0 * 4 + i]);
> + t1 = UNQUANT(q[2], in[1 * 4 + i]);
> + t2 = UNQUANT(q[1], in[2 * 4 + i]);
> + t3 = UNQUANT(q[2], in[3 * 4 + i]);
> + } else {
> + t0 = UNQUANT(q[0], in[0 * 4 + i]);
> + t1 = UNQUANT(q[1], in[1 * 4 + i]);
> + t2 = UNQUANT(q[0], in[2 * 4 + i]);
> + t3 = UNQUANT(q[1], in[3 * 4 + i]);
> + }
Branchless please? Maybe q[0+(i&1)] or such?
> +static const uint8_t tscc2_zigzag[16] = {
> + 0, 1, 4, 8,
> + 5, 2, 3, 6,
> + 9, 12, 13, 10,
> + 7, 11, 14, 15
> +// 0, 4, 1, 2,
> +// 5, 8, 12, 9,
> +// 6, 3, 7, 10,
> +// 13, 14, 11, 15
> +};
Use an existing one if possible?
Otherwise I can't see anything much to complain about.
Jason
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel