diff --git a/source/Lib/CommonLib/Picture.cpp b/source/Lib/CommonLib/Picture.cpp index 286a11519ca77ac8ccf353e8caa49bc76fa6fdab..fffa5ac8f0ffee649284898eeff49735dcecd3d6 100644 --- a/source/Lib/CommonLib/Picture.cpp +++ b/source/Lib/CommonLib/Picture.cpp @@ -364,7 +364,25 @@ const TFilterCoeff DownsamplingFilterSRC[8][16][12] = { 0, 0, 0, 1, -5, 16, 125, -12, 3, 0, 0, 0 }, { 0, 0, 0, 0, -2, 7, 127, -6, 2, 0, 0, 0 } }, - { // D = 1.5 + { // Kaiser(7)-windowed sinc ratio 1.35 +#if JVET_AD0169_SMALL_SCALE_DOWNSAMPLING + { 0, 0, 4, -14, 27, 94, 27, -14, 4, 0, 0, 0 }, + { 0, 0, 4, -13, 21, 94, 32, -14, 3, 1, 0, 0 }, + { 0, 0, 4, -12, 16, 93, 39, -15, 3, 1, -1, 0 }, + { 0, 0, 4, -11, 11, 92, 45, -15, 2, 1, -1, 0 }, + { 0, -1, 4, -10, 7, 89, 51, -14, 1, 2, -1, 0 }, + { 0, -1, 4, -8, 2, 86, 57, -13, 0, 2, -1, 0 }, + { 0, -1, 4, -7, -1, 82, 63, -12, -1, 2, -1, 0 }, + { 0, -1, 4, -5, -5, 78, 68, -10, -3, 3, -1, 0 }, + { 0, -1, 3, -4, -8, 74, 74, -8, -4, 3, -1, 0 }, + { 0, -1, 3, -3, -10, 68, 78, -5, -5, 4, -1, 0 }, + { 0, -1, 2, -1, -12, 63, 82, -1, -7, 4, -1, 0 }, + { 0, -1, 2, 0, -13, 57, 86, 2, -8, 4, -1, 0 }, + { 0, -1, 2, 1, -14, 51, 89, 7, -10, 4, -1, 0 }, + { 0, -1, 1, 2, -15, 45, 92, 11, -11, 4, 0, 0 }, + { 0, -1, 1, 3, -15, 39, 93, 16, -12, 4, 0, 0 }, + { 0, 0, 1, 3, -14, 32, 94, 21, -13, 4, 0, 0 } +#else { 0, 2, 0, -14, 33, 86, 33, -14, 0, 2, 0, 0 }, { 0, 1, 1, -14, 29, 85, 38, -13, -1, 2, 0, 0 }, { 0, 1, 2, -14, 24, 84, 43, -12, -2, 2, 0, 0 }, @@ -381,6 +399,7 @@ const TFilterCoeff DownsamplingFilterSRC[8][16][12] = { 0, 0, 2, -3, -11, 48, 83, 19, -13, 2, 1, 0 }, { 0, 0, 2, -2, -12, 43, 84, 24, -14, 2, 1, 0 }, { 0, 0, 2, -1, -13, 38, 85, 29, -14, 1, 1, 0 } +#endif }, { // D = 2 { 0, 5, -6, -10, 37, 76, 37, -10, -6, 5, 0, 0}, //0 @@ -684,11 +703,19 @@ void Picture::sampleRateConv(const ScalingRatio scalingRatio, const int scaleX, { horFilter = 3; } +#if JVET_AD0169_SMALL_SCALE_DOWNSAMPLING + else if (scalingRatio.x > (27 << ScalingRatio::BITS) / 20) +#else else if (scalingRatio.x > (5 << ScalingRatio::BITS) / 4) +#endif { horFilter = 2; } +#if JVET_AD0169_SMALL_SCALE_DOWNSAMPLING + else if (scalingRatio.x > (11 << ScalingRatio::BITS) / 10) +#else else if (scalingRatio.x > (20 << ScalingRatio::BITS) / 19) +#endif { horFilter = 1; } @@ -713,11 +740,19 @@ void Picture::sampleRateConv(const ScalingRatio scalingRatio, const int scaleX, { verFilter = 3; } +#if JVET_AD0169_SMALL_SCALE_DOWNSAMPLING + else if (scalingRatio.y > (27 << ScalingRatio::BITS) / 20) +#else else if (scalingRatio.y > (5 << ScalingRatio::BITS) / 4) +#endif { verFilter = 2; } +#if JVET_AD0169_SMALL_SCALE_DOWNSAMPLING + else if (scalingRatio.y > (11 << ScalingRatio::BITS) / 10) +#else else if (scalingRatio.y > (20 << ScalingRatio::BITS) / 19) +#endif { verFilter = 1; } diff --git a/source/Lib/CommonLib/TypeDef.h b/source/Lib/CommonLib/TypeDef.h index 3e7cf0d1cdb0b08819a9ae08ecd24add3c37a8b8..fba9189bb7029e6396b87cfae919d116bfa07d18 100644 --- a/source/Lib/CommonLib/TypeDef.h +++ b/source/Lib/CommonLib/TypeDef.h @@ -56,6 +56,7 @@ //########### place macros to be removed in next cycle below this line ############### +#define JVET_AD0169_SMALL_SCALE_DOWNSAMPLING 1 // JVET-AD0169: Downsampling filters in range 1.1 to 1.35 based on Kaiser(7) windowed sinc //########### place macros to be be kept below this line ###############