On Mon, Sep 09, 2013 at 12:04:29PM +0200, Vittorio Giovara wrote:
> On Sun, Aug 11, 2013 at 3:33 PM, Anton Khirnov <[email protected]> wrote:
> > --- /dev/null
> > +++ b/libavcodec/hevc.c
> > @@ -0,0 +1,2661 @@
> [...]
> > +static const uint8_t scan_1x1[1] = {
> > +    0,
> > +};
> > +
> > +static const uint8_t horiz_scan2x2_x[4] = {
> > +    0, 1, 0, 1,
> > +};
> > +
> > +static const uint8_t horiz_scan2x2_y[4] = {
> > +    0, 0, 1, 1
> > +};
> > +
> > +static const uint8_t horiz_scan4x4_x[16] = {
> > +    0, 1, 2, 3,
> > +    0, 1, 2, 3,
> > +    0, 1, 2, 3,
> > +    0, 1, 2, 3,
> > +};
> > +
> > +static const uint8_t horiz_scan4x4_y[16] = {
> > +    0, 0, 0, 0,
> > +    1, 1, 1, 1,
> > +    2, 2, 2, 2,
> > +    3, 3, 3, 3,
> > +};
> > +
> > +static const uint8_t horiz_scan8x8_inv[8][8] = {
> > +    {  0,  1,  2,  3, 16, 17, 18, 19, },
> > +    {  4,  5,  6,  7, 20, 21, 22, 23, },
> > +    {  8,  9, 10, 11, 24, 25, 26, 27, },
> > +    { 12, 13, 14, 15, 28, 29, 30, 31, },
> > +    { 32, 33, 34, 35, 48, 49, 50, 51, },
> > +    { 36, 37, 38, 39, 52, 53, 54, 55, },
> > +    { 40, 41, 42, 43, 56, 57, 58, 59, },
> > +    { 44, 45, 46, 47, 60, 61, 62, 63, },
> > +};
> > +
> > +static const uint8_t diag_scan4x1_x[4] = {
> > +    0, 1, 2, 3,
> > +};
> > +
> > +static const uint8_t diag_scan1x4_y[4] = {
> > +    0, 1, 2, 3,
> > +};
> > +
> > +static const uint8_t diag_scan2x2_x[4] = {
> > +    0, 0, 1, 1,
> > +};
> > +
> > +static const uint8_t diag_scan2x2_y[4] = {
> > +    0, 1, 0, 1,
> > +};
> > +
> > +static const uint8_t diag_scan2x2_inv[2][2] = {
> > +    { 0, 2, },
> > +    { 1, 3, },
> > +};
> > +
> > +static const uint8_t diag_scan8x2_x[16] = {
> > +    0, 0, 1, 1,
> > +    2, 2, 3, 3,
> > +    4, 4, 5, 5,
> > +    6, 6, 7, 7,
> > +};
> > +
> > +static const uint8_t diag_scan8x2_y[16] = {
> > +    0, 1, 0, 1,
> > +    0, 1, 0, 1,
> > +    0, 1, 0, 1,
> > +    0, 1, 0, 1,
> > +};
> > +
> > +
> > +static const uint8_t diag_scan8x2_inv[2][8] = {
> > +    { 0, 2, 4, 6, 8, 10, 12, 14, },
> > +    { 1, 3, 5, 7, 9, 11, 13, 15, },
> > +};
> > +
> > +static const uint8_t diag_scan2x8_x[16] = {
> > +    0, 0, 1, 0,
> > +    1, 0, 1, 0,
> > +    1, 0, 1, 0,
> > +    1, 0, 1, 1,
> > +};
> > +
> > +static const uint8_t diag_scan2x8_y[16] = {
> > +    0, 1, 0, 2,
> > +    1, 3, 2, 4,
> > +    3, 5, 4, 6,
> > +    5, 7, 6, 7,
> > +};
> > +
> > +static const uint8_t diag_scan2x8_inv[8][2] = {
> > +    {  0,  2, },
> > +    {  1,  4, },
> > +    {  3,  6, },
> > +    {  5,  8, },
> > +    {  7, 10, },
> > +    {  9, 12, },
> > +    { 11, 14, },
> > +    { 13, 15, },
> > +};
> > +
> > +static const uint8_t diag_scan4x4_x[16] = {
> > +    0, 0, 1, 0,
> > +    1, 2, 0, 1,
> > +    2, 3, 1, 2,
> > +    3, 2, 3, 3,
> > +};
> > +
> > +static const uint8_t diag_scan4x4_y[16] = {
> > +    0, 1, 0, 2,
> > +    1, 0, 3, 2,
> > +    1, 0, 3, 2,
> > +    1, 3, 2, 3,
> > +};
> > +
> > +static const uint8_t diag_scan4x4_inv[4][4] = {
> > +    { 0,  2,  5,  9, },
> > +    { 1,  4,  8, 12, },
> > +    { 3,  7, 11, 14, },
> > +    { 6, 10, 13, 15, },
> > +};
> > +
> > +static const uint8_t diag_scan8x8_x[64] = {
> > +    0, 0, 1, 0,
> > +    1, 2, 0, 1,
> > +    2, 3, 0, 1,
> > +    2, 3, 4, 0,
> > +    1, 2, 3, 4,
> > +    5, 0, 1, 2,
> > +    3, 4, 5, 6,
> > +    0, 1, 2, 3,
> > +    4, 5, 6, 7,
> > +    1, 2, 3, 4,
> > +    5, 6, 7, 2,
> > +    3, 4, 5, 6,
> > +    7, 3, 4, 5,
> > +    6, 7, 4, 5,
> > +    6, 7, 5, 6,
> > +    7, 6, 7, 7,
> > +};
> > +
> > +static const uint8_t diag_scan8x8_y[64] = {
> > +    0, 1, 0, 2,
> > +    1, 0, 3, 2,
> > +    1, 0, 4, 3,
> > +    2, 1, 0, 5,
> > +    4, 3, 2, 1,
> > +    0, 6, 5, 4,
> > +    3, 2, 1, 0,
> > +    7, 6, 5, 4,
> > +    3, 2, 1, 0,
> > +    7, 6, 5, 4,
> > +    3, 2, 1, 7,
> > +    6, 5, 4, 3,
> > +    2, 7, 6, 5,
> > +    4, 3, 7, 6,
> > +    5, 4, 7, 6,
> > +    5, 7, 6, 7,
> > +};
> > +
> > +static const uint8_t diag_scan8x8_inv[8][8] = {
> > +    {  0,  2,  5,  9, 14, 20, 27, 35, },
> > +    {  1,  4,  8, 13, 19, 26, 34, 42, },
> > +    {  3,  7, 12, 18, 25, 33, 41, 48, },
> > +    {  6, 11, 17, 24, 32, 40, 47, 53, },
> > +    { 10, 16, 23, 31, 39, 46, 52, 57, },
> > +    { 15, 22, 30, 38, 45, 51, 56, 60, },
> > +    { 21, 29, 37, 44, 50, 55, 59, 62, },
> > +    { 28, 36, 43, 49, 54, 58, 61, 63, },
> > +};
> > +
> 
> I'm not sure what is the situation in the other decoders, but could
> this be maybe moved in a header like hevc_tables.h?

No more static tables in header files please.  That just asks for multiple
#inclusions that bloat up the libs.

Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to