shithub: libvpx

Download patch

ref: 8b970da40dfe69f748a77cbbcc095ff8ca664109
parent: 55b5a68d72253c7f4a810c7940bba8c0079fdd78
author: James Zern <jzern@google.com>
date: Fri Aug 23 15:52:33 EDT 2013

cosmetics: yv12extend add some const

Change-Id: I87f1ce2ceca80d3869dd72ba862329a98eb3e0c2

--- a/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
+++ b/vpx_scale/arm/neon/vp8_vpxyv12_copy_y_neon.asm
@@ -19,7 +19,8 @@
 
     AREA ||.text||, CODE, READONLY, ALIGN=2
 
-;void vpxyv12_copy_y_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc)
+;void vpx_yv12_copy_y_neon(const YV12_BUFFER_CONFIG *src_ybc,
+;                          YV12_BUFFER_CONFIG *dst_ybc)
 |vpx_yv12_copy_y_neon| PROC
     push            {r4 - r11, lr}
     vpush           {d8-d15}
--- a/vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm
+++ b/vpx_scale/arm/neon/vp8_vpxyv12_copyframe_func_neon.asm
@@ -18,7 +18,7 @@
 
     AREA ||.text||, CODE, READONLY, ALIGN=2
 
-;void vp8_yv12_copy_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc,
+;void vp8_yv12_copy_frame_func_neon(const YV12_BUFFER_CONFIG *src_ybc,
 ;                                   YV12_BUFFER_CONFIG *dst_ybc);
 
 |vp8_yv12_copy_frame_func_neon| PROC
--- a/vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm
+++ b/vpx_scale/arm/neon/vp8_vpxyv12_copysrcframe_func_neon.asm
@@ -17,11 +17,12 @@
     INCLUDE vpx_scale_asm_offsets.asm
 
     AREA ||.text||, CODE, READONLY, ALIGN=2
-;Note: This function is used to copy source data in src_buffer[i] at beginning of
-;the encoding. The buffer has a width and height of cpi->oxcf.Width and cpi->oxcf.Height,
-;which can be ANY numbers(NOT always multiples of 16 or 4).
+;Note: This function is used to copy source data in src_buffer[i] at beginning
+;of the encoding. The buffer has a width and height of cpi->oxcf.Width and
+;cpi->oxcf.Height, which can be ANY numbers(NOT always multiples of 16 or 4).
 
-;void vp8_yv12_copy_src_frame_func_neon(YV12_BUFFER_CONFIG *src_ybc, YV12_BUFFER_CONFIG *dst_ybc);
+;void vp8_yv12_copy_src_frame_func_neon(const YV12_BUFFER_CONFIG *src_ybc,
+;                                       YV12_BUFFER_CONFIG *dst_ybc);
 
 |vp8_yv12_copy_src_frame_func_neon| PROC
     push            {r4 - r11, lr}
--- a/vpx_scale/arm/neon/yv12extend_arm.c
+++ b/vpx_scale/arm/neon/yv12extend_arm.c
@@ -10,12 +10,12 @@
 
 #include "./vpx_scale_rtcd.h"
 
-extern void vp8_yv12_copy_frame_func_neon(struct yv12_buffer_config *src_ybc,
-                                          struct yv12_buffer_config *dst_ybc);
+extern void vp8_yv12_copy_frame_func_neon(
+    const struct yv12_buffer_config *src_ybc,
+    struct yv12_buffer_config *dst_ybc);
 
-void vp8_yv12_copy_frame_neon(struct yv12_buffer_config *src_ybc,
+void vp8_yv12_copy_frame_neon(const struct yv12_buffer_config *src_ybc,
                               struct yv12_buffer_config *dst_ybc) {
   vp8_yv12_copy_frame_func_neon(src_ybc, dst_ybc);
-
   vp8_yv12_extend_frame_borders_neon(dst_ybc);
 }
--- a/vpx_scale/generic/yv12extend.c
+++ b/vpx_scale/generic/yv12extend.c
@@ -14,7 +14,7 @@
 #include "vpx_mem/vpx_mem.h"
 #include "vpx_scale/yv12config.h"
 
-static void extend_plane(uint8_t *src, int src_stride,
+static void extend_plane(uint8_t *const src, int src_stride,
                          int width, int height,
                          int extend_top, int extend_left,
                          int extend_bottom, int extend_right) {
@@ -118,7 +118,7 @@
 
 void vp9_extend_frame_inner_borders_c(YV12_BUFFER_CONFIG *ybf,
                                       int subsampling_x, int subsampling_y) {
-  const int inner_bw = ybf->border > VP9INNERBORDERINPIXELS ?
+  const int inner_bw = (ybf->border > VP9INNERBORDERINPIXELS) ?
                        VP9INNERBORDERINPIXELS : ybf->border;
   extend_frame(ybf, subsampling_x, subsampling_y, inner_bw);
 }
@@ -127,7 +127,7 @@
 // Copies the source image into the destination image and updates the
 // destination's UMV borders.
 // Note: The frames are assumed to be identical in size.
-void vp8_yv12_copy_frame_c(YV12_BUFFER_CONFIG *src_ybc,
+void vp8_yv12_copy_frame_c(const YV12_BUFFER_CONFIG *src_ybc,
                            YV12_BUFFER_CONFIG *dst_ybc) {
   int row;
   const uint8_t *src = src_ybc->y_buffer;
@@ -168,7 +168,7 @@
   vp8_yv12_extend_frame_borders_c(dst_ybc);
 }
 
-void vpx_yv12_copy_y_c(YV12_BUFFER_CONFIG *src_ybc,
+void vpx_yv12_copy_y_c(const YV12_BUFFER_CONFIG *src_ybc,
                        YV12_BUFFER_CONFIG *dst_ybc) {
   int row;
   const uint8_t *src = src_ybc->y_buffer;
--- a/vpx_scale/vpx_scale_rtcd.sh
+++ b/vpx_scale/vpx_scale_rtcd.sh
@@ -19,10 +19,10 @@
 prototype void vp8_yv12_extend_frame_borders "struct yv12_buffer_config *ybf"
 specialize vp8_yv12_extend_frame_borders neon
 
-prototype void vp8_yv12_copy_frame "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
+prototype void vp8_yv12_copy_frame "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
 specialize vp8_yv12_copy_frame neon
 
-prototype void vpx_yv12_copy_y "struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
+prototype void vpx_yv12_copy_y "const struct yv12_buffer_config *src_ybc, struct yv12_buffer_config *dst_ybc"
 specialize vpx_yv12_copy_y neon
 
 if [ "$CONFIG_VP9" = "yes" ]; then