Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: source/libvpx/vp9/common/vp9_recon.c

Issue 11974002: libvpx: Pull from upstream (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/libvpx/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/libvpx/vp9/common/vp9_quant_common.h ('k') | source/libvpx/vp9/common/vp9_reconinter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/libvpx/vp9/common/vp9_recon.c
===================================================================
--- source/libvpx/vp9/common/vp9_recon.c (revision 177019)
+++ source/libvpx/vp9/common/vp9_recon.c (working copy)
@@ -9,30 +9,19 @@
*/
-#include "vpx_ports/config.h"
+#include "./vpx_config.h"
#include "vp9_rtcd.h"
#include "vp9/common/vp9_blockd.h"
-void vp9_recon_b_c
-(
- unsigned char *pred_ptr,
- short *diff_ptr,
- unsigned char *dst_ptr,
- int stride
-) {
+void vp9_recon_b_c(uint8_t *pred_ptr,
+ int16_t *diff_ptr,
+ uint8_t *dst_ptr,
+ int stride) {
int r, c;
for (r = 0; r < 4; r++) {
for (c = 0; c < 4; c++) {
- int a = diff_ptr[c] + pred_ptr[c];
-
- if (a < 0)
- a = 0;
-
- if (a > 255)
- a = 255;
-
- dst_ptr[c] = (unsigned char) a;
+ dst_ptr[c] = clip_pixel(diff_ptr[c] + pred_ptr[c]);
}
dst_ptr += stride;
@@ -41,26 +30,15 @@
}
}
-void vp9_recon_uv_b_c
-(
- unsigned char *pred_ptr,
- short *diff_ptr,
- unsigned char *dst_ptr,
- int stride
-) {
+void vp9_recon_uv_b_c(uint8_t *pred_ptr,
+ int16_t *diff_ptr,
+ uint8_t *dst_ptr,
+ int stride) {
int r, c;
for (r = 0; r < 4; r++) {
for (c = 0; c < 4; c++) {
- int a = diff_ptr[c] + pred_ptr[c];
-
- if (a < 0)
- a = 0;
-
- if (a > 255)
- a = 255;
-
- dst_ptr[c] = (unsigned char) a;
+ dst_ptr[c] = clip_pixel(diff_ptr[c] + pred_ptr[c]);
}
dst_ptr += stride;
@@ -68,26 +46,16 @@
pred_ptr += 8;
}
}
-void vp9_recon4b_c
-(
- unsigned char *pred_ptr,
- short *diff_ptr,
- unsigned char *dst_ptr,
- int stride
-) {
+
+void vp9_recon4b_c(uint8_t *pred_ptr,
+ int16_t *diff_ptr,
+ uint8_t *dst_ptr,
+ int stride) {
int r, c;
for (r = 0; r < 4; r++) {
for (c = 0; c < 16; c++) {
- int a = diff_ptr[c] + pred_ptr[c];
-
- if (a < 0)
- a = 0;
-
- if (a > 255)
- a = 255;
-
- dst_ptr[c] = (unsigned char) a;
+ dst_ptr[c] = clip_pixel(diff_ptr[c] + pred_ptr[c]);
}
dst_ptr += stride;
@@ -96,26 +64,15 @@
}
}
-void vp9_recon2b_c
-(
- unsigned char *pred_ptr,
- short *diff_ptr,
- unsigned char *dst_ptr,
- int stride
-) {
+void vp9_recon2b_c(uint8_t *pred_ptr,
+ int16_t *diff_ptr,
+ uint8_t *dst_ptr,
+ int stride) {
int r, c;
for (r = 0; r < 4; r++) {
for (c = 0; c < 8; c++) {
- int a = diff_ptr[c] + pred_ptr[c];
-
- if (a < 0)
- a = 0;
-
- if (a > 255)
- a = 255;
-
- dst_ptr[c] = (unsigned char) a;
+ dst_ptr[c] = clip_pixel(diff_ptr[c] + pred_ptr[c]);
}
dst_ptr += stride;
@@ -124,21 +81,15 @@
}
}
-#if CONFIG_SUPERBLOCKS
void vp9_recon_mby_s_c(MACROBLOCKD *xd, uint8_t *dst) {
int x, y;
BLOCKD *b = &xd->block[0];
int stride = b->dst_stride;
- short *diff = b->diff;
+ int16_t *diff = b->diff;
for (y = 0; y < 16; y++) {
for (x = 0; x < 16; x++) {
- int a = dst[x] + diff[x];
- if (a < 0)
- a = 0;
- else if (a > 255)
- a = 255;
- dst[x] = a;
+ dst[x] = clip_pixel(dst[x] + diff[x]);
}
dst += stride;
diff += 16;
@@ -152,24 +103,48 @@
for (i = 0; i < 2; i++, dst = vdst) {
BLOCKD *b = &xd->block[16 + 4 * i];
int stride = b->dst_stride;
- short *diff = b->diff;
+ int16_t *diff = b->diff;
for (y = 0; y < 8; y++) {
for (x = 0; x < 8; x++) {
- int a = dst[x] + diff[x];
- if (a < 0)
- a = 0;
- else if (a > 255)
- a = 255;
- dst[x] = a;
+ dst[x] = clip_pixel(dst[x] + diff[x]);
}
dst += stride;
diff += 8;
}
}
}
-#endif
+void vp9_recon_sby_s_c(MACROBLOCKD *xd, uint8_t *dst) {
+ int x, y, stride = xd->block[0].dst_stride;
+ int16_t *diff = xd->sb_coeff_data.diff;
+
+ for (y = 0; y < 32; y++) {
+ for (x = 0; x < 32; x++) {
+ dst[x] = clip_pixel(dst[x] + diff[x]);
+ }
+ dst += stride;
+ diff += 32;
+ }
+}
+
+void vp9_recon_sbuv_s_c(MACROBLOCKD *xd, uint8_t *udst, uint8_t *vdst) {
+ int x, y, stride = xd->block[16].dst_stride;
+ int16_t *udiff = xd->sb_coeff_data.diff + 1024;
+ int16_t *vdiff = xd->sb_coeff_data.diff + 1280;
+
+ for (y = 0; y < 16; y++) {
+ for (x = 0; x < 16; x++) {
+ udst[x] = clip_pixel(udst[x] + udiff[x]);
+ vdst[x] = clip_pixel(vdst[x] + vdiff[x]);
+ }
+ udst += stride;
+ vdst += stride;
+ udiff += 16;
+ vdiff += 16;
+ }
+}
+
void vp9_recon_mby_c(MACROBLOCKD *xd) {
int i;
« no previous file with comments | « source/libvpx/vp9/common/vp9_quant_common.h ('k') | source/libvpx/vp9/common/vp9_reconinter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698