yuv: Patched to make static analysis happy (warned about unused variable).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
diff --git a/src/video/yuv2rgb/yuv_rgb_std_func.h b/src/video/yuv2rgb/yuv_rgb_std_func.h
index bf4f48e..f0ab5c6 100644
--- a/src/video/yuv2rgb/yuv_rgb_std_func.h
+++ b/src/video/yuv2rgb/yuv_rgb_std_func.h
@@ -77,20 +77,20 @@ void STD_FUNCTION_NAME(
{
const YUV2RGBParam *const param = &(YUV2RGB[yuv_type]);
#if YUV_FORMAT == YUV_FORMAT_420
- const int y_pixel_stride = 1;
- const int uv_pixel_stride = 1;
- const int uv_x_sample_interval = 2;
- const int uv_y_sample_interval = 2;
+ #define y_pixel_stride 1
+ #define uv_pixel_stride 1
+ #define uv_x_sample_interval 2
+ #define uv_y_sample_interval 2
#elif YUV_FORMAT == YUV_FORMAT_422
- const int y_pixel_stride = 2;
- const int uv_pixel_stride = 4;
- const int uv_x_sample_interval = 2;
- const int uv_y_sample_interval = 1;
+ #define y_pixel_stride 2
+ #define uv_pixel_stride 4
+ #define uv_x_sample_interval 2
+ #define uv_y_sample_interval 1
#elif YUV_FORMAT == YUV_FORMAT_NV12
- const int y_pixel_stride = 1;
- const int uv_pixel_stride = 2;
- const int uv_x_sample_interval = 2;
- const int uv_y_sample_interval = 2;
+ #define y_pixel_stride 1
+ #define uv_pixel_stride 2
+ #define uv_x_sample_interval 2
+ #define uv_y_sample_interval 2
#endif
uint32_t x, y;
@@ -101,9 +101,12 @@ void STD_FUNCTION_NAME(
*u_ptr=U+(y/uv_y_sample_interval)*UV_stride,
*v_ptr=V+(y/uv_y_sample_interval)*UV_stride;
- uint8_t *rgb_ptr1=RGB+y*RGB_stride,
- *rgb_ptr2=RGB+(y+1)*RGB_stride;
-
+ uint8_t *rgb_ptr1=RGB+y*RGB_stride;
+
+ #if uv_y_sample_interval > 1
+ uint8_t *rgb_ptr2=RGB+(y+1)*RGB_stride;
+ #endif
+
for(x=0; x<(width-(uv_x_sample_interval-1)); x+=uv_x_sample_interval)
{
// Compute U and V contributions, common to the four pixels
@@ -123,13 +126,13 @@ void STD_FUNCTION_NAME(
y_tmp = ((y_ptr1[y_pixel_stride]-param->y_shift)*param->y_factor);
PACK_PIXEL(rgb_ptr1);
- if (uv_y_sample_interval > 1) {
- y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor);
- PACK_PIXEL(rgb_ptr2);
+ #if uv_y_sample_interval > 1
+ y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor);
+ PACK_PIXEL(rgb_ptr2);
- y_tmp = ((y_ptr2[y_pixel_stride]-param->y_shift)*param->y_factor);
- PACK_PIXEL(rgb_ptr2);
- }
+ y_tmp = ((y_ptr2[y_pixel_stride]-param->y_shift)*param->y_factor);
+ PACK_PIXEL(rgb_ptr2);
+ #endif
y_ptr1+=2*y_pixel_stride;
y_ptr2+=2*y_pixel_stride;
@@ -154,10 +157,10 @@ void STD_FUNCTION_NAME(
int32_t y_tmp = ((y_ptr1[0]-param->y_shift)*param->y_factor);
PACK_PIXEL(rgb_ptr1);
- if (uv_y_sample_interval > 1) {
- y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor);
- PACK_PIXEL(rgb_ptr2);
- }
+ #if uv_y_sample_interval > 1
+ y_tmp = ((y_ptr2[0]-param->y_shift)*param->y_factor);
+ PACK_PIXEL(rgb_ptr2);
+ #endif
}
}
@@ -212,6 +215,11 @@ void STD_FUNCTION_NAME(
PACK_PIXEL(rgb_ptr1);
}
}
+
+ #undef y_pixel_stride
+ #undef uv_pixel_stride
+ #undef uv_x_sample_interval
+ #undef uv_y_sample_interval
}
#undef STD_FUNCTION_NAME