From: Dirk Farin Date: Tue, 23 Feb 2021 15:29:01 +0000 (+0100) Subject: [PATCH] fill 32x32 scaling matrices X-Git-Tag: archive/raspbian/1.0.8-1.1+rpi1^2~7 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=051061d8ecd3a15262678fa67403dab3a217dffd;p=libde265.git [PATCH] fill 32x32 scaling matrices Gbp-Pq: Name 0001-fill-32x32-scaling-matrices.patch --- diff --git a/libde265/sps.cc b/libde265/sps.cc index 476cdbb..47c157a 100644 --- a/libde265/sps.cc +++ b/libde265/sps.cc @@ -873,10 +873,10 @@ de265_error read_scaling_list(bitreader* br, const seq_parameter_set* sps, int dc_coeff[4][6]; for (int sizeId=0;sizeId<4;sizeId++) { - int n = ((sizeId==3) ? 2 : 6); + //int n = ((sizeId==3) ? 2 : 6); uint8_t scaling_list[6][32*32]; - for (int matrixId=0;matrixIdScalingFactor_Size1[matrixId][y][x]; + + for (int dy=0;dy<4;dy++) + for (int dx=0;dx<4;dx++) { + sclist->ScalingFactor_Size3[matrixId][4*y+dy][4*x+dx] = v; + } + } + + sclist->ScalingFactor_Size3[matrixId][0][0] = sclist->ScalingFactor_Size1[matrixId][0][0]; + } + return DE265_OK; } diff --git a/libde265/sps.h b/libde265/sps.h index b06151d..2204f65 100644 --- a/libde265/sps.h +++ b/libde265/sps.h @@ -54,7 +54,7 @@ typedef struct scaling_list_data { uint8_t ScalingFactor_Size0[6][4][4]; uint8_t ScalingFactor_Size1[6][8][8]; uint8_t ScalingFactor_Size2[6][16][16]; - uint8_t ScalingFactor_Size3[2][32][32]; + uint8_t ScalingFactor_Size3[6][32][32]; } scaling_list_data; diff --git a/libde265/transform.cc b/libde265/transform.cc index ef404f8..cf07460 100644 --- a/libde265/transform.cc +++ b/libde265/transform.cc @@ -504,10 +504,8 @@ void scale_coefficients_internal(thread_context* tctx, for (int i=0;inCoeff[cIdx];i++) { int pos = tctx->coeffPos[cIdx][i]; - int x = pos%nT; - int y = pos/nT; - const int m_x_y = sclist[x+y*nT]; + const int m_x_y = sclist[pos]; const int fact = m_x_y * levelScale[qP%6] << (qP/6); int64_t currCoeff = tctx->coeffList[cIdx][i];