Commit 239ea04c authored by Loren Merritt's avatar Loren Merritt

decode custom quant matrices.

based on a patch by anonymous, with optimizations by me.

Originally committed as revision 4660 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent fe9a734c
This diff is collapsed.
...@@ -457,61 +457,45 @@ static const uint8_t div6[52]={ ...@@ -457,61 +457,45 @@ static const uint8_t div6[52]={
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
}; };
static const uint16_t dequant_coeff[52][16]={ static const uint8_t default_scaling4[2][16]={
{ 10, 13, 10, 13, 13, 16, 13, 16, 10, 13, 10, 13, 13, 16, 13, 16, }, { 6,13,20,28,
{ 11, 14, 11, 14, 14, 18, 14, 18, 11, 14, 11, 14, 14, 18, 14, 18, }, 13,20,28,32,
{ 13, 16, 13, 16, 16, 20, 16, 20, 13, 16, 13, 16, 16, 20, 16, 20, }, 20,28,32,37,
{ 14, 18, 14, 18, 18, 23, 18, 23, 14, 18, 14, 18, 18, 23, 18, 23, }, 28,32,37,42
{ 16, 20, 16, 20, 20, 25, 20, 25, 16, 20, 16, 20, 20, 25, 20, 25, }, },{
{ 18, 23, 18, 23, 23, 29, 23, 29, 18, 23, 18, 23, 23, 29, 23, 29, }, 10,14,20,24,
{ 20, 26, 20, 26, 26, 32, 26, 32, 20, 26, 20, 26, 26, 32, 26, 32, }, 14,20,24,27,
{ 22, 28, 22, 28, 28, 36, 28, 36, 22, 28, 22, 28, 28, 36, 28, 36, }, 20,24,27,30,
{ 26, 32, 26, 32, 32, 40, 32, 40, 26, 32, 26, 32, 32, 40, 32, 40, }, 24,27,30,34
{ 28, 36, 28, 36, 36, 46, 36, 46, 28, 36, 28, 36, 36, 46, 36, 46, }, }};
{ 32, 40, 32, 40, 40, 50, 40, 50, 32, 40, 32, 40, 40, 50, 40, 50, },
{ 36, 46, 36, 46, 46, 58, 46, 58, 36, 46, 36, 46, 46, 58, 46, 58, }, static const uint8_t default_scaling8[2][64]={
{ 40, 52, 40, 52, 52, 64, 52, 64, 40, 52, 40, 52, 52, 64, 52, 64, }, { 6,10,13,16,18,23,25,27,
{ 44, 56, 44, 56, 56, 72, 56, 72, 44, 56, 44, 56, 56, 72, 56, 72, }, 10,11,16,18,23,25,27,29,
{ 52, 64, 52, 64, 64, 80, 64, 80, 52, 64, 52, 64, 64, 80, 64, 80, }, 13,16,18,23,25,27,29,31,
{ 56, 72, 56, 72, 72, 92, 72, 92, 56, 72, 56, 72, 72, 92, 72, 92, }, 16,18,23,25,27,29,31,33,
{ 64, 80, 64, 80, 80, 100, 80, 100, 64, 80, 64, 80, 80, 100, 80, 100, }, 18,23,25,27,29,31,33,36,
{ 72, 92, 72, 92, 92, 116, 92, 116, 72, 92, 72, 92, 92, 116, 92, 116, }, 23,25,27,29,31,33,36,38,
{ 80, 104, 80, 104, 104, 128, 104, 128, 80, 104, 80, 104, 104, 128, 104, 128, }, 25,27,29,31,33,36,38,40,
{ 88, 112, 88, 112, 112, 144, 112, 144, 88, 112, 88, 112, 112, 144, 112, 144, }, 27,29,31,33,36,38,40,42
{ 104, 128, 104, 128, 128, 160, 128, 160, 104, 128, 104, 128, 128, 160, 128, 160, }, },{
{ 112, 144, 112, 144, 144, 184, 144, 184, 112, 144, 112, 144, 144, 184, 144, 184, }, 9,13,15,17,19,21,22,24,
{ 128, 160, 128, 160, 160, 200, 160, 200, 128, 160, 128, 160, 160, 200, 160, 200, }, 13,13,17,19,21,22,24,25,
{ 144, 184, 144, 184, 184, 232, 184, 232, 144, 184, 144, 184, 184, 232, 184, 232, }, 15,17,19,21,22,24,25,27,
{ 160, 208, 160, 208, 208, 256, 208, 256, 160, 208, 160, 208, 208, 256, 208, 256, }, 17,19,21,22,24,25,27,28,
{ 176, 224, 176, 224, 224, 288, 224, 288, 176, 224, 176, 224, 224, 288, 224, 288, }, 19,21,22,24,25,27,28,30,
{ 208, 256, 208, 256, 256, 320, 256, 320, 208, 256, 208, 256, 256, 320, 256, 320, }, 21,22,24,25,27,28,30,32,
{ 224, 288, 224, 288, 288, 368, 288, 368, 224, 288, 224, 288, 288, 368, 288, 368, }, 22,24,25,27,28,30,32,33,
{ 256, 320, 256, 320, 320, 400, 320, 400, 256, 320, 256, 320, 320, 400, 320, 400, }, 24,25,27,28,30,32,33,35
{ 288, 368, 288, 368, 368, 464, 368, 464, 288, 368, 288, 368, 368, 464, 368, 464, }, }};
{ 320, 416, 320, 416, 416, 512, 416, 512, 320, 416, 320, 416, 416, 512, 416, 512, },
{ 352, 448, 352, 448, 448, 576, 448, 576, 352, 448, 352, 448, 448, 576, 448, 576, }, static const int dequant4_coeff_init[6][3]={
{ 416, 512, 416, 512, 512, 640, 512, 640, 416, 512, 416, 512, 512, 640, 512, 640, }, {10,13,16},
{ 448, 576, 448, 576, 576, 736, 576, 736, 448, 576, 448, 576, 576, 736, 576, 736, }, {11,14,18},
{ 512, 640, 512, 640, 640, 800, 640, 800, 512, 640, 512, 640, 640, 800, 640, 800, }, {13,16,20},
{ 576, 736, 576, 736, 736, 928, 736, 928, 576, 736, 576, 736, 736, 928, 736, 928, }, {14,18,23},
{ 640, 832, 640, 832, 832,1024, 832,1024, 640, 832, 640, 832, 832,1024, 832,1024, }, {16,20,25},
{ 704, 896, 704, 896, 896,1152, 896,1152, 704, 896, 704, 896, 896,1152, 896,1152, }, {18,23,29},
{ 832,1024, 832,1024, 1024,1280,1024,1280, 832,1024, 832,1024, 1024,1280,1024,1280, },
{ 896,1152, 896,1152, 1152,1472,1152,1472, 896,1152, 896,1152, 1152,1472,1152,1472, },
{1024,1280,1024,1280, 1280,1600,1280,1600, 1024,1280,1024,1280, 1280,1600,1280,1600, },
{1152,1472,1152,1472, 1472,1856,1472,1856, 1152,1472,1152,1472, 1472,1856,1472,1856, },
{1280,1664,1280,1664, 1664,2048,1664,2048, 1280,1664,1280,1664, 1664,2048,1664,2048, },
{1408,1792,1408,1792, 1792,2304,1792,2304, 1408,1792,1408,1792, 1792,2304,1792,2304, },
{1664,2048,1664,2048, 2048,2560,2048,2560, 1664,2048,1664,2048, 2048,2560,2048,2560, },
{1792,2304,1792,2304, 2304,2944,2304,2944, 1792,2304,1792,2304, 2304,2944,2304,2944, },
{2048,2560,2048,2560, 2560,3200,2560,3200, 2048,2560,2048,2560, 2560,3200,2560,3200, },
{2304,2944,2304,2944, 2944,3712,2944,3712, 2304,2944,2304,2944, 2944,3712,2944,3712, },
{2560,3328,2560,3328, 3328,4096,3328,4096, 2560,3328,2560,3328, 3328,4096,3328,4096, },
{2816,3584,2816,3584, 3584,4608,3584,4608, 2816,3584,2816,3584, 3584,4608,3584,4608, },
{3328,4096,3328,4096, 4096,5120,4096,5120, 3328,4096,3328,4096, 4096,5120,4096,5120, },
{3584,4608,3584,4608, 4608,5888,4608,5888, 3584,4608,3584,4608, 4608,5888,4608,5888, },
//{4096,5120,4096,5120, 5120,6400,5120,6400, 4096,5120,4096,5120, 5120,6400,5120,6400, },
//{4608,5888,4608,5888, 5888,7424,5888,7424, 4608,5888,4608,5888, 5888,7424,5888,7424, },
}; };
static const int dequant8_coeff_init_scan[16] = { static const int dequant8_coeff_init_scan[16] = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment