diff options
Diffstat (limited to 'vp9')
-rw-r--r-- | vp9/common/vp9_blockd.h | 1 | ||||
-rw-r--r-- | vp9/common/vp9_common_data.h | 2 | ||||
-rw-r--r-- | vp9/common/vp9_convolve.h | 6 | ||||
-rw-r--r-- | vp9/common/vp9_default_coef_probs.h | 3 | ||||
-rw-r--r-- | vp9/common/vp9_entropy.c | 234 | ||||
-rw-r--r-- | vp9/common/vp9_entropymv.c | 14 | ||||
-rw-r--r-- | vp9/common/vp9_entropymv.h | 2 | ||||
-rw-r--r-- | vp9/common/vp9_loopfilter.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_loopfilter_filters.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_mvref_common.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_postproc.c | 40 | ||||
-rw-r--r-- | vp9/common/vp9_pred_common.h | 5 | ||||
-rw-r--r-- | vp9/common/vp9_quant_common.c | 118 | ||||
-rw-r--r-- | vp9/common/vp9_reconintra.c | 2 | ||||
-rw-r--r-- | vp9/common/vp9_rtcd.c | 4 | ||||
-rw-r--r-- | vp9/common/vp9_scale.h | 2 | ||||
-rw-r--r-- | vp9/common/vp9_treecoder.c | 13 | ||||
-rw-r--r-- | vp9/decoder/vp9_treereader.h | 3 | ||||
-rw-r--r-- | vp9/encoder/vp9_encodeframe.c | 323 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_if.c | 127 | ||||
-rw-r--r-- | vp9/encoder/vp9_onyx_int.h | 1 |
21 files changed, 337 insertions, 569 deletions
diff --git a/vp9/common/vp9_blockd.h b/vp9/common/vp9_blockd.h index 9ab2cc31b..ccd220fdb 100644 --- a/vp9/common/vp9_blockd.h +++ b/vp9/common/vp9_blockd.h @@ -244,7 +244,6 @@ typedef struct macroblockd { unsigned char ab_index; // index of 4x4 block inside the 8x8 block int q_index; - } MACROBLOCKD; static INLINE uint8_t *get_sb_index(MACROBLOCKD *xd, BLOCK_SIZE subsize) { diff --git a/vp9/common/vp9_common_data.h b/vp9/common/vp9_common_data.h index 3822bfc08..2945cd203 100644 --- a/vp9/common/vp9_common_data.h +++ b/vp9/common/vp9_common_data.h @@ -29,4 +29,4 @@ extern const TX_SIZE max_txsize_lookup[BLOCK_SIZES]; extern const TX_SIZE max_uv_txsize_lookup[BLOCK_SIZES]; extern const BLOCK_SIZE ss_size_lookup[BLOCK_SIZES][2][2]; -#endif // VP9_COMMON_VP9_COMMON_DATA_H +#endif // VP9_COMMON_VP9_COMMON_DATA_H diff --git a/vp9/common/vp9_convolve.h b/vp9/common/vp9_convolve.h index 13220e97e..3d4cf6914 100644 --- a/vp9/common/vp9_convolve.h +++ b/vp9/common/vp9_convolve.h @@ -7,8 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#ifndef VP9_COMMON_CONVOLVE_H_ -#define VP9_COMMON_CONVOLVE_H_ +#ifndef VP9_COMMON_VP9_CONVOLVE_H_ +#define VP9_COMMON_VP9_CONVOLVE_H_ #include "./vpx_config.h" #include "vpx/vpx_integer.h" @@ -26,4 +26,4 @@ struct subpix_fn_table { const int16_t (*filter_y)[8]; }; -#endif // VP9_COMMON_CONVOLVE_H_ +#endif // VP9_COMMON_VP9_CONVOLVE_H_ diff --git a/vp9/common/vp9_default_coef_probs.h b/vp9/common/vp9_default_coef_probs.h index 185fcedbe..3b512beb9 100644 --- a/vp9/common/vp9_default_coef_probs.h +++ b/vp9/common/vp9_default_coef_probs.h @@ -7,6 +7,8 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ +#ifndef VP9_COMMON_DEFAULT_COEF_PROBS_H_ +#define VP9_COMMON_DEFAULT_COEF_PROBS_H_ /*Generated file, included by vp9_entropy.c*/ static const vp9_coeff_probs_model default_coef_probs_4x4[BLOCK_TYPES] = { @@ -694,3 +696,4 @@ static const vp9_coeff_probs_model default_coef_probs_32x32[BLOCK_TYPES] = { } }; +#endif // VP9_COMMON_DEFAULT_COEF_PROBS_H_ diff --git a/vp9/common/vp9_entropy.c b/vp9/common/vp9_entropy.c index f171c317f..72ea72e09 100644 --- a/vp9/common/vp9_entropy.c +++ b/vp9/common/vp9_entropy.c @@ -107,101 +107,171 @@ DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_8x8[64]) = { }; DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_16x16[256]) = { - 0, 16, 1, 32, 17, 2, 48, 33, 18, 3, 64, 34, 49, 19, 65, 80, - 50, 4, 35, 66, 20, 81, 96, 51, 5, 36, 82, 97, 67, 112, 21, 52, - 98, 37, 83, 113, 6, 68, 128, 53, 22, 99, 114, 84, 7, 129, 38, 69, - 100, 115, 144, 130, 85, 54, 23, 8, 145, 39, 70, 116, 101, 131, 160, 146, - 55, 86, 24, 71, 132, 117, 161, 40, 9, 102, 147, 176, 162, 87, 56, 25, - 133, 118, 177, 148, 72, 103, 41, 163, 10, 192, 178, 88, 57, 134, 149, 119, - 26, 164, 73, 104, 193, 42, 179, 208, 11, 135, 89, 165, 120, 150, 58, 194, - 180, 27, 74, 209, 105, 151, 136, 43, 90, 224, 166, 195, 181, 121, 210, 59, - 12, 152, 106, 167, 196, 75, 137, 225, 211, 240, 182, 122, 91, 28, 197, 13, - 226, 168, 183, 153, 44, 212, 138, 107, 241, 60, 29, 123, 198, 184, 227, 169, - 242, 76, 213, 154, 45, 92, 14, 199, 139, 61, 228, 214, 170, 185, 243, 108, - 77, 155, 30, 15, 200, 229, 124, 215, 244, 93, 46, 186, 171, 201, 109, 140, - 230, 62, 216, 245, 31, 125, 78, 156, 231, 47, 187, 202, 217, 94, 246, 141, - 63, 232, 172, 110, 247, 157, 79, 218, 203, 126, 233, 188, 248, 95, 173, 142, - 219, 111, 249, 234, 158, 127, 189, 204, 250, 235, 143, 174, 220, 205, 159, 251, - 190, 221, 175, 236, 237, 191, 206, 252, 222, 253, 207, 238, 223, 254, 239, 255, + 0, 16, 1, 32, 17, 2, 48, 33, 18, 3, 64, 34, 49, 19, 65, 80, + 50, 4, 35, 66, 20, 81, 96, 51, 5, 36, 82, 97, 67, 112, 21, 52, + 98, 37, 83, 113, 6, 68, 128, 53, 22, 99, 114, 84, 7, 129, 38, 69, + 100, 115, 144, 130, 85, 54, 23, 8, 145, 39, 70, 116, 101, 131, 160, 146, + 55, 86, 24, 71, 132, 117, 161, 40, 9, 102, 147, 176, 162, 87, 56, 25, + 133, 118, 177, 148, 72, 103, 41, 163, 10, 192, 178, 88, 57, 134, 149, 119, + 26, 164, 73, 104, 193, 42, 179, 208, 11, 135, 89, 165, 120, 150, 58, 194, + 180, 27, 74, 209, 105, 151, 136, 43, 90, 224, 166, 195, 181, 121, 210, 59, + 12, 152, 106, 167, 196, 75, 137, 225, 211, 240, 182, 122, 91, 28, 197, 13, + 226, 168, 183, 153, 44, 212, 138, 107, 241, 60, 29, 123, 198, 184, 227, 169, + 242, 76, 213, 154, 45, 92, 14, 199, 139, 61, 228, 214, 170, 185, 243, 108, + 77, 155, 30, 15, 200, 229, 124, 215, 244, 93, 46, 186, 171, 201, 109, 140, + 230, 62, 216, 245, 31, 125, 78, 156, 231, 47, 187, 202, 217, 94, 246, 141, + 63, 232, 172, 110, 247, 157, 79, 218, 203, 126, 233, 188, 248, 95, 173, 142, + 219, 111, 249, 234, 158, 127, 189, 204, 250, 235, 143, 174, 220, 205, 159, + 251, + 190, 221, 175, 236, 237, 191, 206, 252, 222, 253, 207, 238, 223, 254, 239, + 255, }; DECLARE_ALIGNED(16, const int16_t, vp9_col_scan_16x16[256]) = { - 0, 16, 32, 48, 1, 64, 17, 80, 33, 96, 49, 2, 65, 112, 18, 81, - 34, 128, 50, 97, 3, 66, 144, 19, 113, 35, 82, 160, 98, 51, 129, 4, - 67, 176, 20, 114, 145, 83, 36, 99, 130, 52, 192, 5, 161, 68, 115, 21, - 146, 84, 208, 177, 37, 131, 100, 53, 162, 224, 69, 6, 116, 193, 147, 85, - 22, 240, 132, 38, 178, 101, 163, 54, 209, 117, 70, 7, 148, 194, 86, 179, - 225, 23, 133, 39, 164, 8, 102, 210, 241, 55, 195, 118, 149, 71, 180, 24, - 87, 226, 134, 165, 211, 40, 103, 56, 72, 150, 196, 242, 119, 9, 181, 227, - 88, 166, 25, 135, 41, 104, 212, 57, 151, 197, 120, 73, 243, 182, 136, 167, - 213, 89, 10, 228, 105, 152, 198, 26, 42, 121, 183, 244, 168, 58, 137, 229, - 74, 214, 90, 153, 199, 184, 11, 106, 245, 27, 122, 230, 169, 43, 215, 59, - 200, 138, 185, 246, 75, 12, 91, 154, 216, 231, 107, 28, 44, 201, 123, 170, - 60, 247, 232, 76, 139, 13, 92, 217, 186, 248, 155, 108, 29, 124, 45, 202, - 233, 171, 61, 14, 77, 140, 15, 249, 93, 30, 187, 156, 218, 46, 109, 125, - 62, 172, 78, 203, 31, 141, 234, 94, 47, 188, 63, 157, 110, 250, 219, 79, - 126, 204, 173, 142, 95, 189, 111, 235, 158, 220, 251, 127, 174, 143, 205, 236, - 159, 190, 221, 252, 175, 206, 237, 191, 253, 222, 238, 207, 254, 223, 239, 255, + 0, 16, 32, 48, 1, 64, 17, 80, 33, 96, 49, 2, 65, 112, 18, 81, + 34, 128, 50, 97, 3, 66, 144, 19, 113, 35, 82, 160, 98, 51, 129, 4, + 67, 176, 20, 114, 145, 83, 36, 99, 130, 52, 192, 5, 161, 68, 115, 21, + 146, 84, 208, 177, 37, 131, 100, 53, 162, 224, 69, 6, 116, 193, 147, 85, + 22, 240, 132, 38, 178, 101, 163, 54, 209, 117, 70, 7, 148, 194, 86, 179, + 225, 23, 133, 39, 164, 8, 102, 210, 241, 55, 195, 118, 149, 71, 180, 24, + 87, 226, 134, 165, 211, 40, 103, 56, 72, 150, 196, 242, 119, 9, 181, 227, + 88, 166, 25, 135, 41, 104, 212, 57, 151, 197, 120, 73, 243, 182, 136, 167, + 213, 89, 10, 228, 105, 152, 198, 26, 42, 121, 183, 244, 168, 58, 137, 229, + 74, 214, 90, 153, 199, 184, 11, 106, 245, 27, 122, 230, 169, 43, 215, 59, + 200, 138, 185, 246, 75, 12, 91, 154, 216, 231, 107, 28, 44, 201, 123, 170, + 60, 247, 232, 76, 139, 13, 92, 217, 186, 248, 155, 108, 29, 124, 45, 202, + 233, 171, 61, 14, 77, 140, 15, 249, 93, 30, 187, 156, 218, 46, 109, 125, + 62, 172, 78, 203, 31, 141, 234, 94, 47, 188, 63, 157, 110, 250, 219, 79, + 126, 204, 173, 142, 95, 189, 111, 235, 158, 220, 251, 127, 174, 143, 205, + 236, + 159, 190, 221, 252, 175, 206, 237, 191, 253, 222, 238, 207, 254, 223, 239, + 255, }; DECLARE_ALIGNED(16, const int16_t, vp9_row_scan_16x16[256]) = { - 0, 1, 2, 16, 3, 17, 4, 18, 32, 5, 33, 19, 6, 34, 48, 20, - 49, 7, 35, 21, 50, 64, 8, 36, 65, 22, 51, 37, 80, 9, 66, 52, - 23, 38, 81, 67, 10, 53, 24, 82, 68, 96, 39, 11, 54, 83, 97, 69, - 25, 98, 84, 40, 112, 55, 12, 70, 99, 113, 85, 26, 41, 56, 114, 100, - 13, 71, 128, 86, 27, 115, 101, 129, 42, 57, 72, 116, 14, 87, 130, 102, - 144, 73, 131, 117, 28, 58, 15, 88, 43, 145, 103, 132, 146, 118, 74, 160, - 89, 133, 104, 29, 59, 147, 119, 44, 161, 148, 90, 105, 134, 162, 120, 176, - 75, 135, 149, 30, 60, 163, 177, 45, 121, 91, 106, 164, 178, 150, 192, 136, - 165, 179, 31, 151, 193, 76, 122, 61, 137, 194, 107, 152, 180, 208, 46, 166, - 167, 195, 92, 181, 138, 209, 123, 153, 224, 196, 77, 168, 210, 182, 240, 108, - 197, 62, 154, 225, 183, 169, 211, 47, 139, 93, 184, 226, 212, 241, 198, 170, - 124, 155, 199, 78, 213, 185, 109, 227, 200, 63, 228, 242, 140, 214, 171, 186, - 156, 229, 243, 125, 94, 201, 244, 215, 216, 230, 141, 187, 202, 79, 172, 110, - 157, 245, 217, 231, 95, 246, 232, 126, 203, 247, 233, 173, 218, 142, 111, 158, - 188, 248, 127, 234, 219, 249, 189, 204, 143, 174, 159, 250, 235, 205, 220, 175, - 190, 251, 221, 191, 206, 236, 207, 237, 252, 222, 253, 223, 238, 239, 254, 255, + 0, 1, 2, 16, 3, 17, 4, 18, 32, 5, 33, 19, 6, 34, 48, 20, + 49, 7, 35, 21, 50, 64, 8, 36, 65, 22, 51, 37, 80, 9, 66, 52, + 23, 38, 81, 67, 10, 53, 24, 82, 68, 96, 39, 11, 54, 83, 97, 69, + 25, 98, 84, 40, 112, 55, 12, 70, 99, 113, 85, 26, 41, 56, 114, 100, + 13, 71, 128, 86, 27, 115, 101, 129, 42, 57, 72, 116, 14, 87, 130, 102, + 144, 73, 131, 117, 28, 58, 15, 88, 43, 145, 103, 132, 146, 118, 74, 160, + 89, 133, 104, 29, 59, 147, 119, 44, 161, 148, 90, 105, 134, 162, 120, 176, + 75, 135, 149, 30, 60, 163, 177, 45, 121, 91, 106, 164, 178, 150, 192, 136, + 165, 179, 31, 151, 193, 76, 122, 61, 137, 194, 107, 152, 180, 208, 46, 166, + 167, 195, 92, 181, 138, 209, 123, 153, 224, 196, 77, 168, 210, 182, 240, 108, + 197, 62, 154, 225, 183, 169, 211, 47, 139, 93, 184, 226, 212, 241, 198, 170, + 124, 155, 199, 78, 213, 185, 109, 227, 200, 63, 228, 242, 140, 214, 171, 186, + 156, 229, 243, 125, 94, 201, 244, 215, 216, 230, 141, 187, 202, 79, 172, 110, + 157, 245, 217, 231, 95, 246, 232, 126, 203, 247, 233, 173, 218, 142, 111, + 158, + 188, 248, 127, 234, 219, 249, 189, 204, 143, 174, 159, 250, 235, 205, 220, + 175, + 190, 251, 221, 191, 206, 236, 207, 237, 252, 222, 253, 223, 238, 239, 254, + 255, }; DECLARE_ALIGNED(16, const int16_t, vp9_default_scan_32x32[1024]) = { - 0, 32, 1, 64, 33, 2, 96, 65, 34, 128, 3, 97, 66, 160, 129, 35, 98, 4, 67, 130, 161, 192, 36, 99, 224, 5, 162, 193, 68, 131, 37, 100, - 225, 194, 256, 163, 69, 132, 6, 226, 257, 288, 195, 101, 164, 38, 258, 7, 227, 289, 133, 320, 70, 196, 165, 290, 259, 228, 39, 321, 102, 352, 8, 197, - 71, 134, 322, 291, 260, 353, 384, 229, 166, 103, 40, 354, 323, 292, 135, 385, 198, 261, 72, 9, 416, 167, 386, 355, 230, 324, 104, 293, 41, 417, 199, 136, - 262, 387, 448, 325, 356, 10, 73, 418, 231, 168, 449, 294, 388, 105, 419, 263, 42, 200, 357, 450, 137, 480, 74, 326, 232, 11, 389, 169, 295, 420, 106, 451, - 481, 358, 264, 327, 201, 43, 138, 512, 482, 390, 296, 233, 170, 421, 75, 452, 359, 12, 513, 265, 483, 328, 107, 202, 514, 544, 422, 391, 453, 139, 44, 234, - 484, 297, 360, 171, 76, 515, 545, 266, 329, 454, 13, 423, 203, 108, 546, 485, 576, 298, 235, 140, 361, 330, 172, 547, 45, 455, 267, 577, 486, 77, 204, 362, - 608, 14, 299, 578, 109, 236, 487, 609, 331, 141, 579, 46, 15, 173, 610, 363, 78, 205, 16, 110, 237, 611, 142, 47, 174, 79, 206, 17, 111, 238, 48, 143, - 80, 175, 112, 207, 49, 18, 239, 81, 113, 19, 50, 82, 114, 51, 83, 115, 640, 516, 392, 268, 144, 20, 672, 641, 548, 517, 424, 393, 300, 269, 176, 145, - 52, 21, 704, 673, 642, 580, 549, 518, 456, 425, 394, 332, 301, 270, 208, 177, 146, 84, 53, 22, 736, 705, 674, 643, 612, 581, 550, 519, 488, 457, 426, 395, - 364, 333, 302, 271, 240, 209, 178, 147, 116, 85, 54, 23, 737, 706, 675, 613, 582, 551, 489, 458, 427, 365, 334, 303, 241, 210, 179, 117, 86, 55, 738, 707, - 614, 583, 490, 459, 366, 335, 242, 211, 118, 87, 739, 615, 491, 367, 243, 119, 768, 644, 520, 396, 272, 148, 24, 800, 769, 676, 645, 552, 521, 428, 397, 304, - 273, 180, 149, 56, 25, 832, 801, 770, 708, 677, 646, 584, 553, 522, 460, 429, 398, 336, 305, 274, 212, 181, 150, 88, 57, 26, 864, 833, 802, 771, 740, 709, - 678, 647, 616, 585, 554, 523, 492, 461, 430, 399, 368, 337, 306, 275, 244, 213, 182, 151, 120, 89, 58, 27, 865, 834, 803, 741, 710, 679, 617, 586, 555, 493, - 462, 431, 369, 338, 307, 245, 214, 183, 121, 90, 59, 866, 835, 742, 711, 618, 587, 494, 463, 370, 339, 246, 215, 122, 91, 867, 743, 619, 495, 371, 247, 123, - 896, 772, 648, 524, 400, 276, 152, 28, 928, 897, 804, 773, 680, 649, 556, 525, 432, 401, 308, 277, 184, 153, 60, 29, 960, 929, 898, 836, 805, 774, 712, 681, - 650, 588, 557, 526, 464, 433, 402, 340, 309, 278, 216, 185, 154, 92, 61, 30, 992, 961, 930, 899, 868, 837, 806, 775, 744, 713, 682, 651, 620, 589, 558, 527, - 496, 465, 434, 403, 372, 341, 310, 279, 248, 217, 186, 155, 124, 93, 62, 31, 993, 962, 931, 869, 838, 807, 745, 714, 683, 621, 590, 559, 497, 466, 435, 373, - 342, 311, 249, 218, 187, 125, 94, 63, 994, 963, 870, 839, 746, 715, 622, 591, 498, 467, 374, 343, 250, 219, 126, 95, 995, 871, 747, 623, 499, 375, 251, 127, - 900, 776, 652, 528, 404, 280, 156, 932, 901, 808, 777, 684, 653, 560, 529, 436, 405, 312, 281, 188, 157, 964, 933, 902, 840, 809, 778, 716, 685, 654, 592, 561, - 530, 468, 437, 406, 344, 313, 282, 220, 189, 158, 996, 965, 934, 903, 872, 841, 810, 779, 748, 717, 686, 655, 624, 593, 562, 531, 500, 469, 438, 407, 376, 345, - 314, 283, 252, 221, 190, 159, 997, 966, 935, 873, 842, 811, 749, 718, 687, 625, 594, 563, 501, 470, 439, 377, 346, 315, 253, 222, 191, 998, 967, 874, 843, 750, - 719, 626, 595, 502, 471, 378, 347, 254, 223, 999, 875, 751, 627, 503, 379, 255, 904, 780, 656, 532, 408, 284, 936, 905, 812, 781, 688, 657, 564, 533, 440, 409, - 316, 285, 968, 937, 906, 844, 813, 782, 720, 689, 658, 596, 565, 534, 472, 441, 410, 348, 317, 286, 1000, 969, 938, 907, 876, 845, 814, 783, 752, 721, 690, 659, - 628, 597, 566, 535, 504, 473, 442, 411, 380, 349, 318, 287, 1001, 970, 939, 877, 846, 815, 753, 722, 691, 629, 598, 567, 505, 474, 443, 381, 350, 319, 1002, 971, - 878, 847, 754, 723, 630, 599, 506, 475, 382, 351, 1003, 879, 755, 631, 507, 383, 908, 784, 660, 536, 412, 940, 909, 816, 785, 692, 661, 568, 537, 444, 413, 972, - 941, 910, 848, 817, 786, 724, 693, 662, 600, 569, 538, 476, 445, 414, 1004, 973, 942, 911, 880, 849, 818, 787, 756, 725, 694, 663, 632, 601, 570, 539, 508, 477, - 446, 415, 1005, 974, 943, 881, 850, 819, 757, 726, 695, 633, 602, 571, 509, 478, 447, 1006, 975, 882, 851, 758, 727, 634, 603, 510, 479, 1007, 883, 759, 635, 511, - 912, 788, 664, 540, 944, 913, 820, 789, 696, 665, 572, 541, 976, 945, 914, 852, 821, 790, 728, 697, 666, 604, 573, 542, 1008, 977, 946, 915, 884, 853, 822, 791, - 760, 729, 698, 667, 636, 605, 574, 543, 1009, 978, 947, 885, 854, 823, 761, 730, 699, 637, 606, 575, 1010, 979, 886, 855, 762, 731, 638, 607, 1011, 887, 763, 639, - 916, 792, 668, 948, 917, 824, 793, 700, 669, 980, 949, 918, 856, 825, 794, 732, 701, 670, 1012, 981, 950, 919, 888, 857, 826, 795, 764, 733, 702, 671, 1013, 982, - 951, 889, 858, 827, 765, 734, 703, 1014, 983, 890, 859, 766, 735, 1015, 891, 767, 920, 796, 952, 921, 828, 797, 984, 953, 922, 860, 829, 798, 1016, 985, 954, 923, - 892, 861, 830, 799, 1017, 986, 955, 893, 862, 831, 1018, 987, 894, 863, 1019, 895, 924, 956, 925, 988, 957, 926, 1020, 989, 958, 927, 1021, 990, 959, 1022, 991, 1023, + 0, 32, 1, 64, 33, 2, 96, 65, 34, 128, 3, 97, 66, 160, + 129, 35, 98, 4, 67, 130, 161, 192, 36, 99, 224, 5, 162, 193, + 68, 131, 37, 100, + 225, 194, 256, 163, 69, 132, 6, 226, 257, 288, 195, 101, 164, 38, + 258, 7, 227, 289, 133, 320, 70, 196, 165, 290, 259, 228, 39, 321, + 102, 352, 8, 197, + 71, 134, 322, 291, 260, 353, 384, 229, 166, 103, 40, 354, 323, 292, + 135, 385, 198, 261, 72, 9, 416, 167, 386, 355, 230, 324, 104, 293, + 41, 417, 199, 136, + 262, 387, 448, 325, 356, 10, 73, 418, 231, 168, 449, 294, 388, 105, + 419, 263, 42, 200, 357, 450, 137, 480, 74, 326, 232, 11, 389, 169, + 295, 420, 106, 451, + 481, 358, 264, 327, 201, 43, 138, 512, 482, 390, 296, 233, 170, 421, + 75, 452, 359, 12, 513, 265, 483, 328, 107, 202, 514, 544, 422, 391, + 453, 139, 44, 234, + 484, 297, 360, 171, 76, 515, 545, 266, 329, 454, 13, 423, 203, 108, + 546, 485, 576, 298, 235, 140, 361, 330, 172, 547, 45, 455, 267, 577, + 486, 77, 204, 362, + 608, 14, 299, 578, 109, 236, 487, 609, 331, 141, 579, 46, 15, 173, + 610, 363, 78, 205, 16, 110, 237, 611, 142, 47, 174, 79, 206, 17, + 111, 238, 48, 143, + 80, 175, 112, 207, 49, 18, 239, 81, 113, 19, 50, 82, 114, 51, + 83, 115, 640, 516, 392, 268, 144, 20, 672, 641, 548, 517, 424, + 393, 300, 269, 176, 145, + 52, 21, 704, 673, 642, 580, 549, 518, 456, 425, 394, 332, 301, + 270, 208, 177, 146, 84, 53, 22, 736, 705, 674, 643, 612, 581, + 550, 519, 488, 457, 426, 395, + 364, 333, 302, 271, 240, 209, 178, 147, 116, 85, 54, 23, 737, + 706, 675, 613, 582, 551, 489, 458, 427, 365, 334, 303, 241, + 210, 179, 117, 86, 55, 738, 707, + 614, 583, 490, 459, 366, 335, 242, 211, 118, 87, 739, 615, 491, + 367, 243, 119, 768, 644, 520, 396, 272, 148, 24, 800, 769, 676, + 645, 552, 521, 428, 397, 304, + 273, 180, 149, 56, 25, 832, 801, 770, 708, 677, 646, 584, 553, + 522, 460, 429, 398, 336, 305, 274, 212, 181, 150, 88, 57, 26, + 864, 833, 802, 771, 740, 709, + 678, 647, 616, 585, 554, 523, 492, 461, 430, 399, 368, 337, 306, + 275, 244, 213, 182, 151, 120, 89, 58, 27, 865, 834, 803, 741, + 710, 679, 617, 586, 555, 493, + 462, 431, 369, 338, 307, 245, 214, 183, 121, 90, 59, 866, 835, + 742, 711, 618, 587, 494, 463, 370, 339, 246, 215, 122, 91, 867, + 743, 619, 495, 371, 247, 123, + 896, 772, 648, 524, 400, 276, 152, 28, 928, 897, 804, 773, 680, + 649, 556, 525, 432, 401, 308, 277, 184, 153, 60, 29, 960, 929, + 898, 836, 805, 774, 712, 681, + 650, 588, 557, 526, 464, 433, 402, 340, 309, 278, 216, 185, 154, + 92, 61, 30, 992, 961, 930, 899, 868, 837, 806, 775, 744, 713, 682, + 651, 620, 589, 558, 527, + 496, 465, 434, 403, 372, 341, 310, 279, 248, 217, 186, 155, 124, + 93, 62, 31, 993, 962, 931, 869, 838, 807, 745, 714, 683, 621, 590, + 559, 497, 466, 435, 373, + 342, 311, 249, 218, 187, 125, 94, 63, 994, 963, 870, 839, 746, 715, + 622, 591, 498, 467, 374, 343, 250, 219, 126, 95, 995, 871, 747, 623, + 499, 375, 251, 127, + 900, 776, 652, 528, 404, 280, 156, 932, 901, 808, 777, 684, 653, 560, + 529, 436, 405, 312, 281, 188, 157, 964, 933, 902, 840, 809, 778, 716, + 685, 654, 592, 561, + 530, 468, 437, 406, 344, 313, 282, 220, 189, 158, 996, 965, 934, 903, + 872, 841, 810, 779, 748, 717, 686, 655, 624, 593, 562, 531, 500, 469, + 438, 407, 376, 345, + 314, 283, 252, 221, 190, 159, 997, 966, 935, 873, 842, 811, 749, 718, + 687, 625, 594, 563, 501, 470, 439, 377, 346, 315, 253, 222, 191, 998, + 967, 874, 843, 750, + 719, 626, 595, 502, 471, 378, 347, 254, 223, 999, 875, 751, 627, 503, + 379, 255, 904, 780, 656, 532, 408, 284, 936, 905, 812, 781, 688, 657, + 564, 533, 440, 409, + 316, 285, 968, 937, 906, 844, 813, 782, 720, 689, 658, 596, 565, 534, + 472, 441, 410, 348, 317, 286, 1000, 969, 938, 907, 876, 845, 814, 783, + 752, 721, 690, 659, + 628, 597, 566, 535, 504, 473, 442, 411, 380, 349, 318, 287, 1001, 970, + 939, 877, 846, 815, 753, 722, 691, 629, 598, 567, 505, 474, 443, 381, + 350, 319, 1002, 971, + 878, 847, 754, 723, 630, 599, 506, 475, 382, 351, 1003, 879, 755, 631, + 507, 383, 908, 784, 660, 536, 412, 940, 909, 816, 785, 692, 661, 568, + 537, 444, 413, 972, + 941, 910, 848, 817, 786, 724, 693, 662, 600, 569, 538, 476, 445, 414, + 1004, 973, 942, 911, 880, 849, 818, 787, 756, 725, 694, 663, 632, 601, + 570, 539, 508, 477, + 446, 415, 1005, 974, 943, 881, 850, 819, 757, 726, 695, 633, 602, 571, + 509, 478, 447, 1006, 975, 882, 851, 758, 727, 634, 603, 510, 479, + 1007, 883, 759, 635, 511, + 912, 788, 664, 540, 944, 913, 820, 789, 696, 665, 572, 541, 976, 945, + 914, 852, 821, 790, 728, 697, 666, 604, 573, 542, 1008, 977, 946, 915, + 884, 853, 822, 791, + 760, 729, 698, 667, 636, 605, 574, 543, 1009, 978, 947, 885, 854, 823, + 761, 730, 699, 637, 606, 575, 1010, 979, 886, 855, 762, 731, 638, 607, + 1011, 887, 763, 639, + 916, 792, 668, 948, 917, 824, 793, 700, 669, 980, 949, 918, 856, 825, + 794, 732, 701, 670, 1012, 981, 950, 919, 888, 857, 826, 795, 764, 733, + 702, 671, 1013, 982, + 951, 889, 858, 827, 765, 734, 703, 1014, 983, 890, 859, 766, 735, 1015, + 891, 767, 920, 796, 952, 921, 828, 797, 984, 953, 922, 860, 829, 798, + 1016, 985, 954, 923, + 892, 861, 830, 799, 1017, 986, 955, 893, 862, 831, 1018, 987, 894, 863, + 1019, 895, 924, 956, 925, 988, 957, 926, 1020, 989, 958, 927, 1021, + 990, 959, 1022, 991, 1023, }; /* Array indices are identical to previously-existing CONTEXT_NODE indices */ -const vp9_tree_index vp9_coef_tree[ 22] = /* corresponding _CONTEXT_NODEs */ -{ +const vp9_tree_index vp9_coef_tree[ 22] = { -DCT_EOB_TOKEN, 2, /* 0 = EOB */ -ZERO_TOKEN, 4, /* 1 = ZERO */ -ONE_TOKEN, 6, /* 2 = ONE */ diff --git a/vp9/common/vp9_entropymv.c b/vp9/common/vp9_entropymv.c index 2e973e53f..a9e25b727 100644 --- a/vp9/common/vp9_entropymv.c +++ b/vp9/common/vp9_entropymv.c @@ -39,12 +39,12 @@ const vp9_tree_index vp9_mv_class_tree[2 * MV_CLASSES - 2] = { }; struct vp9_token vp9_mv_class_encodings[MV_CLASSES]; -const vp9_tree_index vp9_mv_class0_tree [2 * CLASS0_SIZE - 2] = { +const vp9_tree_index vp9_mv_class0_tree[2 * CLASS0_SIZE - 2] = { -0, -1, }; struct vp9_token vp9_mv_class0_encodings[CLASS0_SIZE]; -const vp9_tree_index vp9_mv_fp_tree [2 * 4 - 2] = { +const vp9_tree_index vp9_mv_fp_tree[2 * 4 - 2] = { -0, 2, -1, 4, -2, -3 @@ -53,8 +53,8 @@ struct vp9_token vp9_mv_fp_encodings[4]; static const nmv_context default_nmv_context = { {32, 64, 96}, - { - { /* vert component */ + { // NOLINT + { /* vert component */ // NOLINT 128, /* sign */ {224, 144, 192, 168, 192, 176, 192, 198, 198, 245}, /* class */ {216}, /* class0 */ @@ -64,7 +64,7 @@ static const nmv_context default_nmv_context = { 160, /* class0_hp bit */ 128, /* hp */ }, - { /* hor component */ + { /* hor component */ // NOLINT 128, /* sign */ {216, 128, 176, 160, 176, 176, 192, 198, 198, 208}, /* class */ {208}, /* class0 */ @@ -149,7 +149,7 @@ int vp9_get_mv_mag(MV_CLASS_TYPE c, int offset) { static void inc_mv_component(int v, nmv_component_counts *comp_counts, int incr, int usehp) { int s, z, c, o, d, e, f; - assert (v != 0); /* should not be zero */ + assert(v != 0); /* should not be zero */ s = v < 0; comp_counts->sign[s] += incr; z = (s ? -v : v) - 1; /* magnitude - 1 */ @@ -198,8 +198,6 @@ static unsigned int adapt_probs(unsigned int i, vp9_prob this_probs[], const vp9_prob last_probs[], const unsigned int num_events[]) { - - const unsigned int left = tree[i] <= 0 ? num_events[-tree[i]] : adapt_probs(tree[i], tree, this_probs, last_probs, num_events); diff --git a/vp9/common/vp9_entropymv.h b/vp9/common/vp9_entropymv.h index a10c933f6..5018c2013 100644 --- a/vp9/common/vp9_entropymv.h +++ b/vp9/common/vp9_entropymv.h @@ -13,7 +13,7 @@ #define VP9_COMMON_VP9_ENTROPYMV_H_ #include "vp9/common/vp9_treecoder.h" -#include "vpx_config.h" +#include "./vpx_config.h" #include "vp9/common/vp9_blockd.h" struct VP9Common; diff --git a/vp9/common/vp9_loopfilter.c b/vp9/common/vp9_loopfilter.c index 6e425e8fb..85ac6d2bf 100644 --- a/vp9/common/vp9_loopfilter.c +++ b/vp9/common/vp9_loopfilter.c @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "vpx_config.h" +#include "./vpx_config.h" #include "vp9/common/vp9_loopfilter.h" #include "vp9/common/vp9_onyxc_int.h" #include "vp9/common/vp9_reconinter.h" diff --git a/vp9/common/vp9_loopfilter_filters.c b/vp9/common/vp9_loopfilter_filters.c index 88130d801..2c4bf6cb2 100644 --- a/vp9/common/vp9_loopfilter_filters.c +++ b/vp9/common/vp9_loopfilter_filters.c @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#include "vpx_config.h" +#include "./vpx_config.h" #include "vp9/common/vp9_common.h" #include "vp9/common/vp9_loopfilter.h" #include "vp9/common/vp9_onyxc_int.h" diff --git a/vp9/common/vp9_mvref_common.c b/vp9/common/vp9_mvref_common.c index a444b8555..659079639 100644 --- a/vp9/common/vp9_mvref_common.c +++ b/vp9/common/vp9_mvref_common.c @@ -108,7 +108,7 @@ static const int idx_n_column_to_subblock[4][2] = { }; // clamp_mv_ref -#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units +#define MV_BORDER (16 << 3) // Allow 16 pels in 1/8th pel units static void clamp_mv_ref(MV *mv, const MACROBLOCKD *xd) { clamp_mv(mv, xd->mb_to_left_edge - MV_BORDER, diff --git a/vp9/common/vp9_postproc.c b/vp9/common/vp9_postproc.c index 955e6766a..212a28ab9 100644 --- a/vp9/common/vp9_postproc.c +++ b/vp9/common/vp9_postproc.c @@ -8,6 +8,9 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include <math.h> +#include <stdlib.h> +#include <stdio.h> #include "./vpx_config.h" #include "vpx_scale/yv12config.h" @@ -18,11 +21,6 @@ #include "./vp9_rtcd.h" #include "./vpx_scale_rtcd.h" - -#include <math.h> -#include <stdlib.h> -#include <stdio.h> - #define RGB_TO_YUV(t) \ ( (0.257*(float)(t >> 16)) + (0.504*(float)(t >> 8 & 0xff)) + \ (0.098*(float)(t & 0xff)) + 16), \ @@ -155,7 +153,6 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr, p_dst = dst_ptr; for (col = 0; col < cols; col++) { - int kernel = 4; int v = p_src[col]; @@ -257,7 +254,7 @@ void vp9_mbpost_proc_across_ip_c(uint8_t *src, int pitch, void vp9_mbpost_proc_down_c(uint8_t *dst, int pitch, int rows, int cols, int flimit) { int r, c, i; - const short *rv3 = &vp9_rv[63 & rand()]; + const short *rv3 = &vp9_rv[63 & rand()]; // NOLINT for (c = 0; c < cols; c++) { uint8_t *s = &dst[c]; @@ -408,7 +405,6 @@ static void fillrd(struct postproc_state *state, int q, int a) { next = next + j; } - } for (; next < 256; next++) @@ -416,7 +412,7 @@ static void fillrd(struct postproc_state *state, int q, int a) { } for (i = 0; i < 3072; i++) { - state->noise[i] = char_dist[rand() & 0xff]; + state->noise[i] = char_dist[rand() & 0xff]; // NOLINT } for (i = 0; i < 16; i++) { @@ -680,13 +676,14 @@ int vp9_post_proc_frame(struct VP9Common *cm, #if 0 && CONFIG_POSTPROC_VISUALIZER if (flags & VP9D_DEBUG_TXT_FRAME_INFO) { char message[512]; - sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", - (cm->frame_type == KEY_FRAME), - cm->refresh_golden_frame, - cm->base_qindex, - cm->filter_level, - flags, - cm->mb_cols, cm->mb_rows); + snprintf(message, sizeof(message) -1, + "F%1dG%1dQ%3dF%3dP%d_s%dx%d", + (cm->frame_type == KEY_FRAME), + cm->refresh_golden_frame, + cm->base_qindex, + cm->filter_level, + flags, + cm->mb_cols, cm->mb_rows); vp9_blit_text(message, cm->post_proc_buffer.y_buffer, cm->post_proc_buffer.y_stride); } @@ -707,7 +704,7 @@ int vp9_post_proc_frame(struct VP9Common *cm, for (j = 0; j < mb_cols; j++) { char zz[4]; - sprintf(zz, "%c", mi[mb_index].mbmi.mode + 'a'); + snprintf(zz, sizeof(zz) - 1, "%c", mi[mb_index].mbmi.mode + 'a'); vp9_blit_text(zz, y_ptr, post->y_stride); mb_index++; @@ -716,7 +713,6 @@ int vp9_post_proc_frame(struct VP9Common *cm, mb_index++; /* border */ y_ptr += post->y_stride * 16 - post->y_width; - } } @@ -740,9 +736,9 @@ int vp9_post_proc_frame(struct VP9Common *cm, mi[mb_index].mbmi.skip_coeff); if (cm->frame_type == KEY_FRAME) - sprintf(zz, "a"); + snprintf(zz, sizeof(zz) - 1, "a"); else - sprintf(zz, "%c", dc_diff + '0'); + snprintf(zz, sizeof(zz) - 1, "%c", dc_diff + '0'); vp9_blit_text(zz, y_ptr, post->y_stride); mb_index++; @@ -751,7 +747,6 @@ int vp9_post_proc_frame(struct VP9Common *cm, mb_index++; /* border */ y_ptr += post->y_stride * 16 - post->y_width; - } } @@ -894,8 +889,9 @@ int vp9_post_proc_frame(struct VP9Common *cm, constrain_line(lx0, &x1, ly0 + 1, &y1, width, height); vp9_blit_line(lx0, x1, ly0 + 1, y1, y_buffer, y_stride); - } else + } else { vp9_blit_line(lx0, x1, ly0, y1, y_buffer, y_stride); + } } mi++; diff --git a/vp9/common/vp9_pred_common.h b/vp9/common/vp9_pred_common.h index 47ca8abd8..3ec9f3416 100644 --- a/vp9/common/vp9_pred_common.h +++ b/vp9/common/vp9_pred_common.h @@ -69,8 +69,9 @@ unsigned char vp9_get_pred_context_comp_inter_inter(const VP9_COMMON *cm, const MACROBLOCKD *xd); -static INLINE vp9_prob vp9_get_pred_prob_comp_inter_inter(const VP9_COMMON *cm, - const MACROBLOCKD *xd) { +static INLINE +vp9_prob vp9_get_pred_prob_comp_inter_inter(const VP9_COMMON *cm, + const MACROBLOCKD *xd) { const int pred_context = vp9_get_pred_context_comp_inter_inter(cm, xd); return cm->fc.comp_inter_prob[pred_context]; } diff --git a/vp9/common/vp9_quant_common.c b/vp9/common/vp9_quant_common.c index bc40854a3..6dbdb4216 100644 --- a/vp9/common/vp9_quant_common.c +++ b/vp9/common/vp9_quant_common.c @@ -14,69 +14,69 @@ #if 1 static const int16_t dc_qlookup[QINDEX_RANGE] = { - 4, 8, 8, 9, 10, 11, 12, 12, - 13, 14, 15, 16, 17, 18, 19, 19, - 20, 21, 22, 23, 24, 25, 26, 26, - 27, 28, 29, 30, 31, 32, 32, 33, - 34, 35, 36, 37, 38, 38, 39, 40, - 41, 42, 43, 43, 44, 45, 46, 47, - 48, 48, 49, 50, 51, 52, 53, 53, - 54, 55, 56, 57, 57, 58, 59, 60, - 61, 62, 62, 63, 64, 65, 66, 66, - 67, 68, 69, 70, 70, 71, 72, 73, - 74, 74, 75, 76, 77, 78, 78, 79, - 80, 81, 81, 82, 83, 84, 85, 85, - 87, 88, 90, 92, 93, 95, 96, 98, - 99, 101, 102, 104, 105, 107, 108, 110, - 111, 113, 114, 116, 117, 118, 120, 121, - 123, 125, 127, 129, 131, 134, 136, 138, - 140, 142, 144, 146, 148, 150, 152, 154, - 156, 158, 161, 164, 166, 169, 172, 174, - 177, 180, 182, 185, 187, 190, 192, 195, - 199, 202, 205, 208, 211, 214, 217, 220, - 223, 226, 230, 233, 237, 240, 243, 247, - 250, 253, 257, 261, 265, 269, 272, 276, - 280, 284, 288, 292, 296, 300, 304, 309, - 313, 317, 322, 326, 330, 335, 340, 344, - 349, 354, 359, 364, 369, 374, 379, 384, - 389, 395, 400, 406, 411, 417, 423, 429, - 435, 441, 447, 454, 461, 467, 475, 482, - 489, 497, 505, 513, 522, 530, 539, 549, - 559, 569, 579, 590, 602, 614, 626, 640, - 654, 668, 684, 700, 717, 736, 755, 775, - 796, 819, 843, 869, 896, 925, 955, 988, + 4, 8, 8, 9, 10, 11, 12, 12, + 13, 14, 15, 16, 17, 18, 19, 19, + 20, 21, 22, 23, 24, 25, 26, 26, + 27, 28, 29, 30, 31, 32, 32, 33, + 34, 35, 36, 37, 38, 38, 39, 40, + 41, 42, 43, 43, 44, 45, 46, 47, + 48, 48, 49, 50, 51, 52, 53, 53, + 54, 55, 56, 57, 57, 58, 59, 60, + 61, 62, 62, 63, 64, 65, 66, 66, + 67, 68, 69, 70, 70, 71, 72, 73, + 74, 74, 75, 76, 77, 78, 78, 79, + 80, 81, 81, 82, 83, 84, 85, 85, + 87, 88, 90, 92, 93, 95, 96, 98, + 99, 101, 102, 104, 105, 107, 108, 110, + 111, 113, 114, 116, 117, 118, 120, 121, + 123, 125, 127, 129, 131, 134, 136, 138, + 140, 142, 144, 146, 148, 150, 152, 154, + 156, 158, 161, 164, 166, 169, 172, 174, + 177, 180, 182, 185, 187, 190, 192, 195, + 199, 202, 205, 208, 211, 214, 217, 220, + 223, 226, 230, 233, 237, 240, 243, 247, + 250, 253, 257, 261, 265, 269, 272, 276, + 280, 284, 288, 292, 296, 300, 304, 309, + 313, 317, 322, 326, 330, 335, 340, 344, + 349, 354, 359, 364, 369, 374, 379, 384, + 389, 395, 400, 406, 411, 417, 423, 429, + 435, 441, 447, 454, 461, 467, 475, 482, + 489, 497, 505, 513, 522, 530, 539, 549, + 559, 569, 579, 590, 602, 614, 626, 640, + 654, 668, 684, 700, 717, 736, 755, 775, + 796, 819, 843, 869, 896, 925, 955, 988, 1022, 1058, 1098, 1139, 1184, 1232, 1282, 1336, }; static const int16_t ac_qlookup[QINDEX_RANGE] = { - 4, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 70, - 71, 72, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, - 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 102, - 104, 106, 108, 110, 112, 114, 116, 118, - 120, 122, 124, 126, 128, 130, 132, 134, - 136, 138, 140, 142, 144, 146, 148, 150, - 152, 155, 158, 161, 164, 167, 170, 173, - 176, 179, 182, 185, 188, 191, 194, 197, - 200, 203, 207, 211, 215, 219, 223, 227, - 231, 235, 239, 243, 247, 251, 255, 260, - 265, 270, 275, 280, 285, 290, 295, 300, - 305, 311, 317, 323, 329, 335, 341, 347, - 353, 359, 366, 373, 380, 387, 394, 401, - 408, 416, 424, 432, 440, 448, 456, 465, - 474, 483, 492, 501, 510, 520, 530, 540, - 550, 560, 571, 582, 593, 604, 615, 627, - 639, 651, 663, 676, 689, 702, 715, 729, - 743, 757, 771, 786, 801, 816, 832, 848, - 864, 881, 898, 915, 933, 951, 969, 988, + 4, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, + 63, 64, 65, 66, 67, 68, 69, 70, + 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, + 104, 106, 108, 110, 112, 114, 116, 118, + 120, 122, 124, 126, 128, 130, 132, 134, + 136, 138, 140, 142, 144, 146, 148, 150, + 152, 155, 158, 161, 164, 167, 170, 173, + 176, 179, 182, 185, 188, 191, 194, 197, + 200, 203, 207, 211, 215, 219, 223, 227, + 231, 235, 239, 243, 247, 251, 255, 260, + 265, 270, 275, 280, 285, 290, 295, 300, + 305, 311, 317, 323, 329, 335, 341, 347, + 353, 359, 366, 373, 380, 387, 394, 401, + 408, 416, 424, 432, 440, 448, 456, 465, + 474, 483, 492, 501, 510, 520, 530, 540, + 550, 560, 571, 582, 593, 604, 615, 627, + 639, 651, 663, 676, 689, 702, 715, 729, + 743, 757, 771, 786, 801, 816, 832, 848, + 864, 881, 898, 915, 933, 951, 969, 988, 1007, 1026, 1046, 1066, 1087, 1108, 1129, 1151, 1173, 1196, 1219, 1243, 1267, 1292, 1317, 1343, 1369, 1396, 1423, 1451, 1479, 1508, 1537, 1567, diff --git a/vp9/common/vp9_reconintra.c b/vp9/common/vp9_reconintra.c index 4a451b909..bd609dcf0 100644 --- a/vp9/common/vp9_reconintra.c +++ b/vp9/common/vp9_reconintra.c @@ -13,7 +13,7 @@ #include "vpx_mem/vpx_mem.h" #include "vpx_ports/vpx_once.h" -#include "vp9_rtcd.h" +#include "./vp9_rtcd.h" #include "vp9/common/vp9_reconintra.h" #include "vp9/common/vp9_onyxc_int.h" diff --git a/vp9/common/vp9_rtcd.c b/vp9/common/vp9_rtcd.c index 72613ae07..dc15a84ff 100644 --- a/vp9/common/vp9_rtcd.c +++ b/vp9/common/vp9_rtcd.c @@ -7,9 +7,9 @@ * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ -#include "vpx_config.h" +#include "./vpx_config.h" #define RTCD_C -#include "vp9_rtcd.h" +#include "./vp9_rtcd.h" #include "vpx_ports/vpx_once.h" void vpx_scale_rtcd(void); diff --git a/vp9/common/vp9_scale.h b/vp9/common/vp9_scale.h index 7a720d035..ece011477 100644 --- a/vp9/common/vp9_scale.h +++ b/vp9/common/vp9_scale.h @@ -48,4 +48,4 @@ static int vp9_is_scaled(const struct scale_factors *sf) { sf->y_scale_fp != REF_NO_SCALE; } -#endif // VP9_COMMON_VP9_SCALE_H_ +#endif // VP9_COMMON_VP9_SCALE_H_ diff --git a/vp9/common/vp9_treecoder.c b/vp9/common/vp9_treecoder.c index 2e21a5b30..da1213d71 100644 --- a/vp9/common/vp9_treecoder.c +++ b/vp9/common/vp9_treecoder.c @@ -25,8 +25,9 @@ static void tree2tok(struct vp9_token *const p, vp9_tree t, if (j <= 0) { p[-j].value = v; p[-j].len = l; - } else + } else { tree2tok(p, t, j, v, l); + } } while (++v & 1); } @@ -65,11 +66,9 @@ static unsigned int convert_distribution(unsigned int i, return left + right; } -void vp9_tree_probs_from_distribution( - vp9_tree tree, - vp9_prob probs [ /* n-1 */ ], - unsigned int branch_ct [ /* n-1 */ ] [2], - const unsigned int num_events[ /* n */ ], - unsigned int tok0_offset) { +void vp9_tree_probs_from_distribution(vp9_tree tree, vp9_prob probs[/* n-1 */], + unsigned int branch_ct[/* n-1 */][2], + const unsigned int num_events[/* n */], + unsigned int tok0_offset) { convert_distribution(0, tree, probs, branch_ct, num_events, tok0_offset); } diff --git a/vp9/decoder/vp9_treereader.h b/vp9/decoder/vp9_treereader.h index 710cc4cd0..f6124973f 100644 --- a/vp9/decoder/vp9_treereader.h +++ b/vp9/decoder/vp9_treereader.h @@ -23,7 +23,8 @@ static int treed_read(vp9_reader *const r, /* !!! must return a 0 or 1 !!! */ const vp9_prob *const p) { register vp9_tree_index i = 0; - while ((i = t[ i + vp9_read(r, p[i >> 1])]) > 0); + while ((i = t[ i + vp9_read(r, p[i >> 1])]) > 0) + continue; return -i; } diff --git a/vp9/encoder/vp9_encodeframe.c b/vp9/encoder/vp9_encodeframe.c index f6045e80b..a2adcd386 100644 --- a/vp9/encoder/vp9_encodeframe.c +++ b/vp9/encoder/vp9_encodeframe.c @@ -951,323 +951,6 @@ static void copy_partitioning(VP9_COMP *cpi, MODE_INFO **mi_8x8, } } -static void set_block_size(VP9_COMMON * const cm, MODE_INFO **mi_8x8, - BLOCK_SIZE bsize, int mis, int mi_row, - int mi_col) { - int r, c; - const int bs = MAX(num_8x8_blocks_wide_lookup[bsize], - num_8x8_blocks_high_lookup[bsize]); - const int idx_str = mis * mi_row + mi_col; - MODE_INFO **const mi2 = &mi_8x8[idx_str]; - - mi2[0] = cm->mi + idx_str; - mi2[0]->mbmi.sb_type = bsize; - - for (r = 0; r < bs; r++) - for (c = 0; c < bs; c++) - if (mi_row + r < cm->mi_rows && mi_col + c < cm->mi_cols) - mi2[r * mis + c] = mi2[0]; -} - -typedef struct { - int64_t sum_square_error; - int64_t sum_error; - int count; - int variance; -} var; - -typedef struct { - var none; - var horz[2]; - var vert[2]; -} partition_variance; - -#define VT(TYPE, BLOCKSIZE) \ - typedef struct { \ - partition_variance vt; \ - BLOCKSIZE split[4]; } TYPE; - -VT(v8x8, var) -VT(v16x16, v8x8) -VT(v32x32, v16x16) -VT(v64x64, v32x32) - -typedef struct { - partition_variance *vt; - var *split[4]; -} vt_node; - -typedef enum { - V16X16, - V32X32, - V64X64, -} TREE_LEVEL; - -static void tree_to_node(void *data, BLOCK_SIZE bsize, vt_node *node) { - int i; - switch (bsize) { - case BLOCK_64X64: { - v64x64 *vt = (v64x64 *) data; - node->vt = &vt->vt; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].vt.none; - break; - } - case BLOCK_32X32: { - v32x32 *vt = (v32x32 *) data; - node->vt = &vt->vt; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].vt.none; - break; - } - case BLOCK_16X16: { - v16x16 *vt = (v16x16 *) data; - node->vt = &vt->vt; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i].vt.none; - break; - } - case BLOCK_8X8: { - v8x8 *vt = (v8x8 *) data; - node->vt = &vt->vt; - for (i = 0; i < 4; i++) - node->split[i] = &vt->split[i]; - break; - } - default: - node->vt = 0; - for (i = 0; i < 4; i++) - node->split[i] = 0; - assert(-1); - } -} - -// Set variance values given sum square error, sum error, count. -static void fill_variance(var *v, int64_t s2, int64_t s, int c) { - v->sum_square_error = s2; - v->sum_error = s; - v->count = c; - if (c > 0) - v->variance = (int)(256 - * (v->sum_square_error - v->sum_error * v->sum_error / v->count) - / v->count); - else - v->variance = 0; -} - -// Combine 2 variance structures by summing the sum_error, sum_square_error, -// and counts and then calculating the new variance. -void sum_2_variances(var *r, var *a, var*b) { - fill_variance(r, a->sum_square_error + b->sum_square_error, - a->sum_error + b->sum_error, a->count + b->count); -} - -static void fill_variance_tree(void *data, BLOCK_SIZE bsize) { - vt_node node; - tree_to_node(data, bsize, &node); - sum_2_variances(&node.vt->horz[0], node.split[0], node.split[1]); - sum_2_variances(&node.vt->horz[1], node.split[2], node.split[3]); - sum_2_variances(&node.vt->vert[0], node.split[0], node.split[2]); - sum_2_variances(&node.vt->vert[1], node.split[1], node.split[3]); - sum_2_variances(&node.vt->none, &node.vt->vert[0], &node.vt->vert[1]); -} - -#if PERFORM_RANDOM_PARTITIONING -static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO *m, - BLOCK_SIZE block_size, int mi_row, - int mi_col, int mi_size) { - VP9_COMMON * const cm = &cpi->common; - vt_node vt; - const int mis = cm->mode_info_stride; - int64_t threshold = 4 * cpi->common.base_qindex * cpi->common.base_qindex; - - tree_to_node(data, block_size, &vt); - - // split none is available only if we have more than half a block size - // in width and height inside the visible image - if (mi_col + mi_size < cm->mi_cols && mi_row + mi_size < cm->mi_rows && - (rand() & 3) < 1) { - set_block_size(cm, m, block_size, mis, mi_row, mi_col); - return 1; - } - - // vertical split is available on all but the bottom border - if (mi_row + mi_size < cm->mi_rows && vt.vt->vert[0].variance < threshold - && (rand() & 3) < 1) { - set_block_size(cm, m, get_subsize(block_size, PARTITION_VERT), mis, mi_row, - mi_col); - return 1; - } - - // horizontal split is available on all but the right border - if (mi_col + mi_size < cm->mi_cols && vt.vt->horz[0].variance < threshold - && (rand() & 3) < 1) { - set_block_size(cm, m, get_subsize(block_size, PARTITION_HORZ), mis, mi_row, - mi_col); - return 1; - } - - return 0; -} - -#else // !PERFORM_RANDOM_PARTITIONING - -static int set_vt_partitioning(VP9_COMP *cpi, void *data, MODE_INFO **m, - BLOCK_SIZE bsize, int mi_row, - int mi_col, int mi_size) { - VP9_COMMON * const cm = &cpi->common; - vt_node vt; - const int mis = cm->mode_info_stride; - int64_t threshold = 50 * cpi->common.base_qindex; - - tree_to_node(data, bsize, &vt); - - // split none is available only if we have more than half a block size - // in width and height inside the visible image - if (mi_col + mi_size < cm->mi_cols && mi_row + mi_size < cm->mi_rows - && vt.vt->none.variance < threshold) { - set_block_size(cm, m, bsize, mis, mi_row, mi_col); - return 1; - } - - // vertical split is available on all but the bottom border - if (mi_row + mi_size < cm->mi_rows && vt.vt->vert[0].variance < threshold - && vt.vt->vert[1].variance < threshold) { - set_block_size(cm, m, get_subsize(bsize, PARTITION_VERT), mis, mi_row, - mi_col); - return 1; - } - - // horizontal split is available on all but the right border - if (mi_col + mi_size < cm->mi_cols && vt.vt->horz[0].variance < threshold - && vt.vt->horz[1].variance < threshold) { - set_block_size(cm, m, get_subsize(bsize, PARTITION_HORZ), mis, mi_row, - mi_col); - return 1; - } - - return 0; -} -#endif // PERFORM_RANDOM_PARTITIONING - -static void choose_partitioning(VP9_COMP *cpi, MODE_INFO **mi_8x8, - int mi_row, int mi_col) { - VP9_COMMON * const cm = &cpi->common; - MACROBLOCK *x = &cpi->mb; - MACROBLOCKD *xd = &cpi->mb.e_mbd; - const int mis = cm->mode_info_stride; - // TODO(JBB): More experimentation or testing of this threshold; - int64_t threshold = 4; - int i, j, k; - v64x64 vt; - unsigned char * s; - int sp; - const unsigned char * d; - int dp; - int pixels_wide = 64, pixels_high = 64; - - vp9_zero(vt); - set_offsets(cpi, mi_row, mi_col, BLOCK_64X64); - - if (xd->mb_to_right_edge < 0) - pixels_wide += (xd->mb_to_right_edge >> 3); - - if (xd->mb_to_bottom_edge < 0) - pixels_high += (xd->mb_to_bottom_edge >> 3); - - s = x->plane[0].src.buf; - sp = x->plane[0].src.stride; - - // TODO(JBB): Clearly the higher the quantizer the fewer partitions we want - // but this needs more experimentation. - threshold = threshold * cpi->common.base_qindex * cpi->common.base_qindex; - - d = vp9_64x64_zeros; - dp = 64; - if (cm->frame_type != KEY_FRAME) { - int_mv nearest_mv, near_mv; - const int idx = cm->ref_frame_map[get_ref_frame_idx(cpi, LAST_FRAME)]; - YV12_BUFFER_CONFIG *ref_fb = &cm->yv12_fb[idx]; - YV12_BUFFER_CONFIG *second_ref_fb = NULL; - - setup_pre_planes(xd, 0, ref_fb, mi_row, mi_col, - &xd->scale_factor[0]); - setup_pre_planes(xd, 1, second_ref_fb, mi_row, mi_col, - &xd->scale_factor[1]); - - xd->this_mi->mbmi.ref_frame[0] = LAST_FRAME; - xd->this_mi->mbmi.sb_type = BLOCK_64X64; - vp9_find_best_ref_mvs(xd, - mi_8x8[0]->mbmi.ref_mvs[mi_8x8[0]->mbmi.ref_frame[0]], - &nearest_mv, &near_mv); - - xd->this_mi->mbmi.mv[0] = nearest_mv; - vp9_build_inter_predictors_sby(xd, mi_row, mi_col, BLOCK_64X64); - - d = xd->plane[0].dst.buf; - dp = xd->plane[0].dst.stride; - } - - // Fill in the entire tree of 8x8 variances for splits. - for (i = 0; i < 4; i++) { - const int x32_idx = ((i & 1) << 5); - const int y32_idx = ((i >> 1) << 5); - for (j = 0; j < 4; j++) { - const int x16_idx = x32_idx + ((j & 1) << 4); - const int y16_idx = y32_idx + ((j >> 1) << 4); - v16x16 *vst = &vt.split[i].split[j]; - for (k = 0; k < 4; k++) { - int x_idx = x16_idx + ((k & 1) << 3); - int y_idx = y16_idx + ((k >> 1) << 3); - unsigned int sse = 0; - int sum = 0; - if (x_idx < pixels_wide && y_idx < pixels_high) - vp9_get_sse_sum_8x8(s + y_idx * sp + x_idx, sp, - d + y_idx * dp + x_idx, dp, &sse, &sum); - fill_variance(&vst->split[k].vt.none, sse, sum, 64); - } - } - } - // Fill the rest of the variance tree by summing the split partition - // values. - for (i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - fill_variance_tree(&vt.split[i].split[j], BLOCK_16X16); - } - fill_variance_tree(&vt.split[i], BLOCK_32X32); - } - fill_variance_tree(&vt, BLOCK_64X64); - // Now go through the entire structure, splitting every block size until - // we get to one that's got a variance lower than our threshold, or we - // hit 8x8. - if (!set_vt_partitioning(cpi, &vt, mi_8x8, BLOCK_64X64, mi_row, mi_col, - 4)) { - for (i = 0; i < 4; ++i) { - const int x32_idx = ((i & 1) << 2); - const int y32_idx = ((i >> 1) << 2); - if (!set_vt_partitioning(cpi, &vt.split[i], mi_8x8, BLOCK_32X32, - (mi_row + y32_idx), (mi_col + x32_idx), 2)) { - for (j = 0; j < 4; ++j) { - const int x16_idx = ((j & 1) << 1); - const int y16_idx = ((j >> 1) << 1); - if (!set_vt_partitioning(cpi, &vt.split[i].split[j], mi_8x8, - BLOCK_16X16, - (mi_row + y32_idx + y16_idx), - (mi_col + x32_idx + x16_idx), 1)) { - for (k = 0; k < 4; ++k) { - const int x8_idx = (k & 1); - const int y8_idx = (k >> 1); - set_block_size(cm, mi_8x8, BLOCK_8X8, mis, - (mi_row + y32_idx + y16_idx + y8_idx), - (mi_col + x32_idx + x16_idx + x8_idx)); - } - } - } - } - } - } -} - static void rd_use_partition(VP9_COMP *cpi, MODE_INFO **mi_8x8, TOKENEXTRA **tp, int mi_row, int mi_col, BLOCK_SIZE bsize, int *rate, int64_t *dist, @@ -2060,7 +1743,7 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp, if (cpi->sf.reference_masking) rd_pick_reference_frame(cpi, mi_row, mi_col); - if (cpi->sf.partition_by_variance || cpi->sf.use_lastframe_partitioning || + if (cpi->sf.use_lastframe_partitioning || cpi->sf.use_one_partition_size_always ) { const int idx_str = cm->mode_info_stride * mi_row + mi_col; MODE_INFO **mi_8x8 = cm->mi_grid_visible + idx_str; @@ -2072,10 +1755,6 @@ static void encode_sb_row(VP9_COMP *cpi, int mi_row, TOKENEXTRA **tp, set_partitioning(cpi, mi_8x8, mi_row, mi_col); rd_use_partition(cpi, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64, &dummy_rate, &dummy_dist, 1); - } else if (cpi->sf.partition_by_variance) { - choose_partitioning(cpi, cm->mi_grid_visible, mi_row, mi_col); - rd_use_partition(cpi, mi_8x8, tp, mi_row, mi_col, BLOCK_64X64, - &dummy_rate, &dummy_dist, 1); } else { if ((cpi->common.current_video_frame % cpi->sf.last_partitioning_redo_frequency) == 0 diff --git a/vp9/encoder/vp9_onyx_if.c b/vp9/encoder/vp9_onyx_if.c index d815dc96a..1a1ea9ec5 100644 --- a/vp9/encoder/vp9_onyx_if.c +++ b/vp9/encoder/vp9_onyx_if.c @@ -195,17 +195,17 @@ static void init_minq_luts(void) { gf_low_motion_minq[i] = calculate_minq_index(maxq, 0.0000015, -0.0009, - 0.33, + 0.32, 0.0); gf_high_motion_minq[i] = calculate_minq_index(maxq, 0.0000021, -0.00125, - 0.45, + 0.50, 0.0); inter_minq[i] = calculate_minq_index(maxq, 0.00000271, -0.00113, - 0.697, + 0.75, 0.0); afq_low_motion_minq[i] = calculate_minq_index(maxq, 0.0000015, @@ -220,6 +220,27 @@ static void init_minq_luts(void) { } } +static int get_active_quality(int q, + int gfu_boost, + int low, + int high, + int *low_motion_minq, + int *high_motion_minq) { + int active_best_quality; + if (gfu_boost > high) { + active_best_quality = low_motion_minq[q]; + } else if (gfu_boost < low) { + active_best_quality = high_motion_minq[q]; + } else { + const int gap = high - low; + const int offset = high - gfu_boost; + const int qdiff = high_motion_minq[q] - low_motion_minq[q]; + const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap; + active_best_quality = low_motion_minq[q] + adjustment; + } + return active_best_quality; +} + static void set_mvcost(MACROBLOCK *mb) { if (mb->e_mbd.allow_high_precision_mv) { mb->mvcost = mb->nmvcost_hp; @@ -703,7 +724,6 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->adaptive_motion_search = 0; sf->use_avoid_tested_higherror = 0; sf->reference_masking = 0; - sf->partition_by_variance = 0; sf->use_one_partition_size_always = 0; sf->less_rectangular_check = 0; sf->use_square_partition_only = 0; @@ -826,8 +846,12 @@ void vp9_set_speed_features(VP9_COMP *cpi) { sf->mode_skip_start = 6; } if (speed == 3) { + sf->less_rectangular_check = 1; + sf->use_square_partition_only = 1; sf->comp_inter_joint_search_thresh = BLOCK_SIZES; - sf->partition_by_variance = 1; + sf->use_lastframe_partitioning = 1; + sf->adjust_partitioning_from_last_frame = 1; + sf->last_partitioning_redo_frequency = 3; sf->tx_size_search_method = ((cpi->common.frame_type == KEY_FRAME || cpi->common.intra_only || cpi->common.show_frame == 0) ? @@ -839,17 +863,23 @@ void vp9_set_speed_features(VP9_COMP *cpi) { FLAG_SKIP_COMP_REFMISMATCH | FLAG_SKIP_INTRA_LOWVAR | FLAG_EARLY_TERMINATE; + sf->intra_y_mode_mask = INTRA_DC_ONLY; + sf->intra_uv_mode_mask = INTRA_DC_ONLY; + sf->use_uv_intra_rd_estimate = 1; sf->use_rd_breakout = 1; sf->skip_encode_sb = 1; sf->use_lp32x32fdct = 1; + sf->adaptive_motion_search = 1; + sf->using_small_partition_info = 0; sf->disable_splitmv = 1; sf->auto_mv_step_size = 1; sf->search_method = BIGDIA; sf->subpel_iters_per_step = 1; + sf->use_fast_lpf_pick = 1; + sf->auto_min_max_partition_size = 1; + sf->auto_min_max_partition_interval = 2; sf->disable_split_var_thresh = 64; sf->disable_filter_search_var_thresh = 64; - sf->intra_y_mode_mask = INTRA_DC_ONLY; - sf->intra_uv_mode_mask = INTRA_DC_ONLY; sf->use_fast_coef_updates = 2; sf->mode_skip_start = 6; } @@ -2702,18 +2732,10 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, double q_val; // Baseline value derived from cpi->active_worst_quality and kf boost - if (cpi->kf_boost > high) { - cpi->active_best_quality = kf_low_motion_minq[q]; - } else if (cpi->kf_boost < low) { - cpi->active_best_quality = kf_high_motion_minq[q]; - } else { - const int gap = high - low; - const int offset = high - cpi->kf_boost; - const int qdiff = kf_high_motion_minq[q] - kf_low_motion_minq[q]; - const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap; - - cpi->active_best_quality = kf_low_motion_minq[q] + adjustment; - } + cpi->active_best_quality = get_active_quality(q, cpi->kf_boost, + low, high, + kf_low_motion_minq, + kf_high_motion_minq); // Allow somewhat lower kf minq with small image formats. if ((cm->width * cm->height) <= (352 * 288)) { @@ -2748,47 +2770,48 @@ static void encode_frame_to_data_rate(VP9_COMP *cpi, q = cpi->avg_frame_qindex; } // For constrained quality dont allow Q less than the cq level - if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY && - q < cpi->cq_target_quality) { - q = cpi->cq_target_quality; - } - if (cpi->gfu_boost > high) { - cpi->active_best_quality = gf_low_motion_minq[q]; - } else if (cpi->gfu_boost < low) { - cpi->active_best_quality = gf_high_motion_minq[q]; - } else { - const int gap = high - low; - const int offset = high - cpi->gfu_boost; - const int qdiff = gf_high_motion_minq[q] - gf_low_motion_minq[q]; - const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap; - - cpi->active_best_quality = gf_low_motion_minq[q] + adjustment; - } - - // Constrained quality use slightly lower active best. - if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) + if (cpi->oxcf.end_usage == USAGE_CONSTRAINED_QUALITY) { + if (q < cpi->cq_target_quality) + q = cpi->cq_target_quality; + if (cpi->frames_since_key > 1) { + cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost, + low, high, + afq_low_motion_minq, + afq_high_motion_minq); + } else { + cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost, + low, high, + gf_low_motion_minq, + gf_high_motion_minq); + } + // Constrained quality use slightly lower active best. cpi->active_best_quality = cpi->active_best_quality * 15 / 16; - // TODO(debargha): Refine the logic below - if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) { + } else if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) { if (!cpi->refresh_alt_ref_frame) { cpi->active_best_quality = cpi->cq_target_quality; } else { if (cpi->frames_since_key > 1) { - if (cpi->gfu_boost > high) { - cpi->active_best_quality = afq_low_motion_minq[q]; - } else if (cpi->gfu_boost < low) { - cpi->active_best_quality = afq_high_motion_minq[q]; - } else { - const int gap = high - low; - const int offset = high - cpi->gfu_boost; - const int qdiff = afq_high_motion_minq[q] - afq_low_motion_minq[q]; - const int adjustment = ((offset * qdiff) + (gap >> 1)) / gap; - - cpi->active_best_quality = afq_low_motion_minq[q] + adjustment; - } + cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost, + low, high, + afq_low_motion_minq, + afq_high_motion_minq); + } else { + cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost, + low, high, + gf_low_motion_minq, + gf_high_motion_minq); } } + } else { + if (!cpi->refresh_alt_ref_frame) { + cpi->active_best_quality = inter_minq[q]; + } else { + cpi->active_best_quality = get_active_quality(q, cpi->gfu_boost, + low, high, + gf_low_motion_minq, + gf_high_motion_minq); + } } } else { if (cpi->oxcf.end_usage == USAGE_CONSTANT_QUALITY) { diff --git a/vp9/encoder/vp9_onyx_int.h b/vp9/encoder/vp9_onyx_int.h index a106014f8..1002ff756 100644 --- a/vp9/encoder/vp9_onyx_int.h +++ b/vp9/encoder/vp9_onyx_int.h @@ -250,7 +250,6 @@ typedef struct { TX_SIZE_SEARCH_METHOD tx_size_search_method; int use_lp32x32fdct; int use_avoid_tested_higherror; - int partition_by_variance; int use_one_partition_size_always; int less_rectangular_check; int use_square_partition_only; |