History

avfilter/vf_spp: Add dummy element to array to avoid shift

Andreas Rheinhardt committed 5 years ago

Commit e424d1f1 parent a85d2de1 file · +4 −3Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_spp.c+4−3
@@ -93,7 +93,8 @@ DECLARE_ALIGNED(8, static const uint8_t, ldither)[8][8] = { · 92 unmodified lines
93 { 42, 26, 38, 22, 41, 25, 37, 21 },93 { 42, 26, 38, 22, 41, 25, 37, 21 },
94};94};
95 95
96static const uint8_t offset[127][2] = {96static const uint8_t offset[128][2] = {
97 {0,0}, // unused
97 {0,0},98 {0,0},
98 {0,0}, {4,4}, // quality = 199 {0,0}, {4,4}, // quality = 1
99 {0,0}, {2,2}, {6,4}, {4,6}, // quality = 2100 {0,0}, {2,2}, {6,4}, {4,6}, // quality = 2
@@ -283,8 +284,8 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src, · 183 unmodified lines
283 qp = FFMAX(1, ff_norm_qscale(qp, p->qscale_type));284 qp = FFMAX(1, ff_norm_qscale(qp, p->qscale_type));
284 }285 }
285 for (i = 0; i < count; i++) {286 for (i = 0; i < count; i++) {
286 const int x1 = x + offset[i + count - 1][0];287 const int x1 = x + offset[i + count][0];
287 const int y1 = y + offset[i + count - 1][1];288 const int y1 = y + offset[i + count][1];
288 const int index = x1 + y1*linesize;289 const int index = x1 + y1*linesize;
289 p->dct->get_pixels_unaligned(block, p->src + sample_bytes*index, sample_bytes*linesize);290 p->dct->get_pixels_unaligned(block, p->src + sample_bytes*index, sample_bytes*linesize);
290 p->dct->fdct(block);291 p->dct->fdct(block);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t