Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6d69447d authored by Lajos Molnar's avatar Lajos Molnar Committed by Automerger Merge Worker
Browse files

Merge "codec2: adjust RGB to YUV matrices" into tm-dev am: ea499586

parents 756eb6ba ea499586
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -532,12 +532,14 @@ MediaImage2 CreateYUV420SemiPlanarMediaImage2(
// Matrix coefficient to convert RGB to Planar YUV data.
// Each sub-array represents the 3X3 coeff used with R, G and B
static const int16_t bt601Matrix[2][3][3] = {
    { { 76, 150, 29 }, { -43, -85, 128 }, { 128, -107, -21 } }, /* RANGE_FULL */
    { { 77, 150, 29 }, { -43, -85, 128 }, { 128, -107, -21 } }, /* RANGE_FULL */
    { { 66, 129, 25 }, { -38, -74, 112 }, { 112, -94, -18 } },  /* RANGE_LIMITED */
};

static const int16_t bt709Matrix[2][3][3] = {
    { { 54, 183, 18 }, { -29, -99, 128 }, { 128, -116, -12 } }, /* RANGE_FULL */
    // TRICKY: 18 is adjusted to 19 so that sum of row 1 is 256
    { { 54, 183, 19 }, { -29, -99, 128 }, { 128, -116, -12 } }, /* RANGE_FULL */
    // TRICKY: -87 is adjusted to -86 so that sum of row 2 is 0
    { { 47, 157, 16 }, { -26, -86, 112 }, { 112, -102, -10 } }, /* RANGE_LIMITED */
};