Skip to content

Commit

Permalink
replace left-shift with *4 (#225)
Browse files Browse the repository at this point in the history
  • Loading branch information
farindk committed Feb 23, 2021
1 parent 0bc5d3b commit 4c0fe2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libde265/deblock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ void edge_filtering_chroma_internal(de265_image* img, bool vertical,


for (int k=0;k<4;k++) {
int delta = Clip3(-tc,tc, ((((q[0][k]-p[0][k])<<2)+p[1][k]-q[1][k]+4)>>3));
int delta = Clip3(-tc,tc, ((((q[0][k]-p[0][k])*4)+p[1][k]-q[1][k]+4)>>3)); // standard says <<2 in eq. (8-356), but the value can also be negative
logtrace(LogDeblock,"delta=%d\n",delta);
if (filterP) { ptr[-1+k*stride] = Clip_BitDepth(p[0][k]+delta, bitDepth_C); }
if (filterQ) { ptr[ 0+k*stride] = Clip_BitDepth(q[0][k]-delta, bitDepth_C); }
Expand All @@ -860,7 +860,7 @@ void edge_filtering_chroma_internal(de265_image* img, bool vertical,
if (img->get_cu_transquant_bypass(SubWidthC*xDi,SubHeightC*yDi)) filterQ=false;

for (int k=0;k<4;k++) {
int delta = Clip3(-tc,tc, ((((q[0][k]-p[0][k])<<2)+p[1][k]-q[1][k]+4)>>3));
int delta = Clip3(-tc,tc, ((((q[0][k]-p[0][k])*4)+p[1][k]-q[1][k]+4)>>3)); // standard says <<2, but the value can also be negative
if (filterP) { ptr[ k-1*stride] = Clip_BitDepth(p[0][k]+delta, bitDepth_C); }
if (filterQ) { ptr[ k+0*stride] = Clip_BitDepth(q[0][k]-delta, bitDepth_C); }
}
Expand Down

0 comments on commit 4c0fe2c

Please sign in to comment.