Commit 7f13b33a authored by Jim Bankoski's avatar Jim Bankoski Committed by Gerrit Code Review
Browse files

Merge "cpplint issues resolved in vp9_postproc.c"

Showing with 18 additions and 22 deletions
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#include "./vpx_config.h" #include "./vpx_config.h"
#include "vpx_scale/yv12config.h" #include "vpx_scale/yv12config.h"
...@@ -18,11 +21,6 @@ ...@@ -18,11 +21,6 @@
#include "./vp9_rtcd.h" #include "./vp9_rtcd.h"
#include "./vpx_scale_rtcd.h" #include "./vpx_scale_rtcd.h"
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#define RGB_TO_YUV(t) \ #define RGB_TO_YUV(t) \
( (0.257*(float)(t >> 16)) + (0.504*(float)(t >> 8 & 0xff)) + \ ( (0.257*(float)(t >> 16)) + (0.504*(float)(t >> 8 & 0xff)) + \
(0.098*(float)(t & 0xff)) + 16), \ (0.098*(float)(t & 0xff)) + 16), \
...@@ -155,7 +153,6 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr, ...@@ -155,7 +153,6 @@ void vp9_post_proc_down_and_across_c(const uint8_t *src_ptr,
p_dst = dst_ptr; p_dst = dst_ptr;
for (col = 0; col < cols; col++) { for (col = 0; col < cols; col++) {
int kernel = 4; int kernel = 4;
int v = p_src[col]; int v = p_src[col];
...@@ -257,7 +254,7 @@ void vp9_mbpost_proc_across_ip_c(uint8_t *src, int pitch, ...@@ -257,7 +254,7 @@ void vp9_mbpost_proc_across_ip_c(uint8_t *src, int pitch,
void vp9_mbpost_proc_down_c(uint8_t *dst, int pitch, void vp9_mbpost_proc_down_c(uint8_t *dst, int pitch,
int rows, int cols, int flimit) { int rows, int cols, int flimit) {
int r, c, i; int r, c, i;
const short *rv3 = &vp9_rv[63 & rand()]; const short *rv3 = &vp9_rv[63 & rand()]; // NOLINT
for (c = 0; c < cols; c++) { for (c = 0; c < cols; c++) {
uint8_t *s = &dst[c]; uint8_t *s = &dst[c];
...@@ -408,7 +405,6 @@ static void fillrd(struct postproc_state *state, int q, int a) { ...@@ -408,7 +405,6 @@ static void fillrd(struct postproc_state *state, int q, int a) {
next = next + j; next = next + j;
} }
} }
for (; next < 256; next++) for (; next < 256; next++)
...@@ -416,7 +412,7 @@ static void fillrd(struct postproc_state *state, int q, int a) { ...@@ -416,7 +412,7 @@ static void fillrd(struct postproc_state *state, int q, int a) {
} }
for (i = 0; i < 3072; i++) { for (i = 0; i < 3072; i++) {
state->noise[i] = char_dist[rand() & 0xff]; state->noise[i] = char_dist[rand() & 0xff]; // NOLINT
} }
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {
...@@ -680,13 +676,14 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -680,13 +676,14 @@ int vp9_post_proc_frame(struct VP9Common *cm,
#if 0 && CONFIG_POSTPROC_VISUALIZER #if 0 && CONFIG_POSTPROC_VISUALIZER
if (flags & VP9D_DEBUG_TXT_FRAME_INFO) { if (flags & VP9D_DEBUG_TXT_FRAME_INFO) {
char message[512]; char message[512];
sprintf(message, "F%1dG%1dQ%3dF%3dP%d_s%dx%d", snprintf(message, sizeof(message) -1,
(cm->frame_type == KEY_FRAME), "F%1dG%1dQ%3dF%3dP%d_s%dx%d",
cm->refresh_golden_frame, (cm->frame_type == KEY_FRAME),
cm->base_qindex, cm->refresh_golden_frame,
cm->filter_level, cm->base_qindex,
flags, cm->filter_level,
cm->mb_cols, cm->mb_rows); flags,
cm->mb_cols, cm->mb_rows);
vp9_blit_text(message, cm->post_proc_buffer.y_buffer, vp9_blit_text(message, cm->post_proc_buffer.y_buffer,
cm->post_proc_buffer.y_stride); cm->post_proc_buffer.y_stride);
} }
...@@ -707,7 +704,7 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -707,7 +704,7 @@ int vp9_post_proc_frame(struct VP9Common *cm,
for (j = 0; j < mb_cols; j++) { for (j = 0; j < mb_cols; j++) {
char zz[4]; char zz[4];
sprintf(zz, "%c", mi[mb_index].mbmi.mode + 'a'); snprintf(zz, sizeof(zz) - 1, "%c", mi[mb_index].mbmi.mode + 'a');
vp9_blit_text(zz, y_ptr, post->y_stride); vp9_blit_text(zz, y_ptr, post->y_stride);
mb_index++; mb_index++;
...@@ -716,7 +713,6 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -716,7 +713,6 @@ int vp9_post_proc_frame(struct VP9Common *cm,
mb_index++; /* border */ mb_index++; /* border */
y_ptr += post->y_stride * 16 - post->y_width; y_ptr += post->y_stride * 16 - post->y_width;
} }
} }
...@@ -740,9 +736,9 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -740,9 +736,9 @@ int vp9_post_proc_frame(struct VP9Common *cm,
mi[mb_index].mbmi.skip_coeff); mi[mb_index].mbmi.skip_coeff);
if (cm->frame_type == KEY_FRAME) if (cm->frame_type == KEY_FRAME)
sprintf(zz, "a"); snprintf(zz, sizeof(zz) - 1, "a");
else else
sprintf(zz, "%c", dc_diff + '0'); snprintf(zz, sizeof(zz) - 1, "%c", dc_diff + '0');
vp9_blit_text(zz, y_ptr, post->y_stride); vp9_blit_text(zz, y_ptr, post->y_stride);
mb_index++; mb_index++;
...@@ -751,7 +747,6 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -751,7 +747,6 @@ int vp9_post_proc_frame(struct VP9Common *cm,
mb_index++; /* border */ mb_index++; /* border */
y_ptr += post->y_stride * 16 - post->y_width; y_ptr += post->y_stride * 16 - post->y_width;
} }
} }
...@@ -894,8 +889,9 @@ int vp9_post_proc_frame(struct VP9Common *cm, ...@@ -894,8 +889,9 @@ int vp9_post_proc_frame(struct VP9Common *cm,
constrain_line(lx0, &x1, ly0 + 1, &y1, width, height); constrain_line(lx0, &x1, ly0 + 1, &y1, width, height);
vp9_blit_line(lx0, x1, ly0 + 1, y1, y_buffer, y_stride); vp9_blit_line(lx0, x1, ly0 + 1, y1, y_buffer, y_stride);
} else } else {
vp9_blit_line(lx0, x1, ly0, y1, y_buffer, y_stride); vp9_blit_line(lx0, x1, ly0, y1, y_buffer, y_stride);
}
} }
mi++; mi++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment