History

VP8: idct_mb optimizations

Currently uses AV_RL32 instead of AV_RL32A, as the latter doesn't exist yet. (cherry picked from commit 62457f9052ea15123688455aad866cb070634f13)

Jason Garrett-Glaser committed 15 years ago

Commit a1b0a3c1 parent a239d531 file · +16 −16Browse files

Unified · Split

libavcodec/vp8.c+16−16
@@ -1421,17 +1421,17 @@ static av_always_inline void idct_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblo · 1420 unmodified lines
1421 if (mb->mode != MODE_I4x4) {1421 if (mb->mode != MODE_I4x4) {
1422 uint8_t *y_dst = dst[0];1422 uint8_t *y_dst = dst[0];
1423 for (y = 0; y < 4; y++) {1423 for (y = 0; y < 4; y++) {
1424 uint32_t nnz4 = AV_RN32A(s->non_zero_count_cache[y]);1424 uint32_t nnz4 = AV_RL32(s->non_zero_count_cache[y]);
1425 if (nnz4) {1425 if (nnz4) {
1426 if (nnz4&~0x01010101) {1426 if (nnz4&~0x01010101) {
1427 for (x = 0; x < 4; x++) {1427 for (x = 0; x < 4; x++) {
1428 int nnz = s->non_zero_count_cache[y][x];1428 if ((uint8_t)nnz4 == 1)
1429 if (nnz) {1429 s->vp8dsp.vp8_idct_dc_add(y_dst+4*x, s->block[y][x], s->linesize);
1430 if (nnz == 1)1430 else if((uint8_t)nnz4 > 1)
1431 s->vp8dsp.vp8_idct_dc_add(y_dst+4*x, s->block[y][x], s->linesize);1431 s->vp8dsp.vp8_idct_add(y_dst+4*x, s->block[y][x], s->linesize);
1432 else1432 nnz4 >>= 8;
1433 s->vp8dsp.vp8_idct_add(y_dst+4*x, s->block[y][x], s->linesize);1433 if (!nnz4)
1434 }1434 break;
1435 }1435 }
1436 } else {1436 } else {
1437 s->vp8dsp.vp8_idct_dc_add4y(y_dst, s->block[y], s->linesize);1437 s->vp8dsp.vp8_idct_dc_add4y(y_dst, s->block[y], s->linesize);
@@ -1442,19 +1442,19 @@ static av_always_inline void idct_mb(VP8Context *s, uint8_t *dst[3], VP8Macroblo · 4 unmodified lines
1442 }1442 }
1443 1443
1444 for (ch = 0; ch < 2; ch++) {1444 for (ch = 0; ch < 2; ch++) {
1445 uint32_t nnz4 = AV_RN32A(s->non_zero_count_cache[4+ch]);1445 uint32_t nnz4 = AV_RL32(s->non_zero_count_cache[4+ch]);
1446 if (nnz4) {1446 if (nnz4) {
1447 uint8_t *ch_dst = dst[1+ch];1447 uint8_t *ch_dst = dst[1+ch];
1448 if (nnz4&~0x01010101) {1448 if (nnz4&~0x01010101) {
1449 for (y = 0; y < 2; y++) {1449 for (y = 0; y < 2; y++) {
1450 for (x = 0; x < 2; x++) {1450 for (x = 0; x < 2; x++) {
1451 int nnz = s->non_zero_count_cache[4+ch][(y<<1)+x];1451 if ((uint8_t)nnz4 == 1)
1452 if (nnz) {1452 s->vp8dsp.vp8_idct_dc_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize);
1453 if (nnz == 1)1453 else if((uint8_t)nnz4 > 1)
1454 s->vp8dsp.vp8_idct_dc_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize);1454 s->vp8dsp.vp8_idct_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize);
1455 else1455 nnz4 >>= 8;
1456 s->vp8dsp.vp8_idct_add(ch_dst+4*x, s->block[4+ch][(y<<1)+x], s->uvlinesize);1456 if (!nnz4)
1457 }1457 break;
1458 }1458 }
1459 ch_dst += 4*s->uvlinesize;1459 ch_dst += 4*s->uvlinesize;
1460 }1460 }

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