summaryrefslogtreecommitdiff
path: root/libavcodec/hevcpred_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-11-02 00:31:49 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-11-02 00:44:54 +0100
commitf578e5d9376a20243f4286776f79a1e1c33b12cd (patch)
tree64e66bed1735b7264a017a91d3946dd25441d9b5 /libavcodec/hevcpred_template.c
parent38612379bffe371d2e21b876b80c335bb468c2fa (diff)
downloadffmpeg-f578e5d9376a20243f4286776f79a1e1c33b12cd.tar.gz
avcodec/hevc: Adjust white-spaces to reduce difference to 064698d381e1e7790f21b0199a8930ea04e2e942
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/hevcpred_template.c')
-rw-r--r--libavcodec/hevcpred_template.c139
1 files changed, 72 insertions, 67 deletions
diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c
index 8a338499a2..86097234f3 100644
--- a/libavcodec/hevcpred_template.c
+++ b/libavcodec/hevcpred_template.c
@@ -92,9 +92,9 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
pixel filtered_top_array[2 * MAX_TB_SIZE + 1];
pixel *left = left_array + 1;
- pixel *top = top_array + 1;
+ pixel *top = top_array + 1;
pixel *filtered_left = filtered_left_array + 1;
- pixel *filtered_top = filtered_top_array + 1;
+ pixel *filtered_top = filtered_top_array + 1;
int cand_bottom_left = lc->na.cand_bottom_left && cur_tb_addr > MIN_TB_ADDR_ZS(x_tb - 1, y_tb + size_in_tbs);
int cand_left = lc->na.cand_left;
@@ -109,9 +109,9 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
if (s->pps->constrained_intra_pred_flag == 1) {
int size_in_luma_pu = PU(size_in_luma);
- int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
- int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
- if(!size_in_luma_pu)
+ int on_pu_edge_x = !(x0 & ((1 << s->sps->log2_min_pu_size) - 1));
+ int on_pu_edge_y = !(y0 & ((1 << s->sps->log2_min_pu_size) - 1));
+ if (!size_in_luma_pu)
size_in_luma_pu++;
if (cand_bottom_left == 1 && on_pu_edge_x) {
int x_left_pu = PU(x0 - 1);
@@ -157,7 +157,8 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
}
if (cand_bottom_left) {
for (i = size + bottom_left_size; i < (size << 1); i++)
- if (IS_INTRA(-1, size + bottom_left_size - 1) || !s->pps->constrained_intra_pred_flag)
+ if (IS_INTRA(-1, size + bottom_left_size - 1) ||
+ !s->pps->constrained_intra_pred_flag)
left[i] = POS(-1, size + bottom_left_size - 1);
for (i = size + bottom_left_size - 1; i >= size; i--)
if (IS_INTRA(-1, i) || !s->pps->constrained_intra_pred_flag)
@@ -178,7 +179,8 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
top[i] = POS(i, -1);
if (cand_up_right) {
for (i = size + top_right_size; i < (size << 1); i++)
- if (IS_INTRA(size + top_right_size - 1, -1) || !s->pps->constrained_intra_pred_flag)
+ if (IS_INTRA(size + top_right_size - 1, -1) ||
+ !s->pps->constrained_intra_pred_flag)
top[i] = POS(size + top_right_size - 1, -1);
for (i = size + top_right_size - 1; i >= size; i--)
if (IS_INTRA(i, -1) || !s->pps->constrained_intra_pred_flag)
@@ -201,29 +203,32 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
size : (s->sps->height - y0) >> vshift;
}
if (cand_bottom_left || cand_left || cand_up_left) {
- while (j>-1 && !IS_INTRA(-1, j)) j--;
+ while (j > -1 && !IS_INTRA(-1, j))
+ j--;
if (!IS_INTRA(-1, j)) {
j = 0;
- while(j < size_max_x && !IS_INTRA(j, -1)) j++;
- EXTEND_LEFT_CIP(top, j, j+1);
+ while (j < size_max_x && !IS_INTRA(j, -1))
+ j++;
+ EXTEND_LEFT_CIP(top, j, j + 1);
left[-1] = top[-1];
- j = 0;
+ j = 0;
}
} else {
j = 0;
- while (j < size_max_x && !IS_INTRA(j, -1)) j++;
+ while (j < size_max_x && !IS_INTRA(j, -1))
+ j++;
if (j > 0)
if (x0 > 0) {
- EXTEND_LEFT_CIP(top, j, j+1);
+ EXTEND_LEFT_CIP(top, j, j + 1);
} else {
EXTEND_LEFT_CIP(top, j, j);
top[-1] = top[0];
}
left[-1] = top[-1];
- j = 0;
+ j = 0;
}
if (cand_bottom_left || cand_left) {
- EXTEND_DOWN_CIP(left, j, size_max_y-j);
+ EXTEND_DOWN_CIP(left, j, size_max_y - j);
}
if (!cand_left) {
EXTEND_DOWN(left, 0, size);
@@ -233,10 +238,10 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
}
if (x0 != 0 && y0 != 0) {
EXTEND_UP_CIP(left, size_max_y - 1, size_max_y);
- } else if( x0 == 0) {
+ } else if (x0 == 0) {
EXTEND_UP_CIP_0(left, size_max_y - 1, size_max_y);
- } else{
- EXTEND_UP_CIP(left, size_max_y - 1, size_max_y-1);
+ } else {
+ EXTEND_UP_CIP(left, size_max_y - 1, size_max_y - 1);
}
top[-1] = left[-1];
if (y0 != 0) {
@@ -255,14 +260,14 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
left[-1] = top[0];
EXTEND_DOWN(left, 0, 2 * size);
cand_up_left = 1;
- cand_left = 1;
+ cand_left = 1;
} else if (cand_up_right) {
EXTEND_LEFT(top, size, size);
left[-1] = top[0];
- EXTEND_DOWN(left ,0 , 2 * size);
- cand_up = 1;
+ EXTEND_DOWN(left, 0, 2 * size);
+ cand_up = 1;
cand_up_left = 1;
- cand_left = 1;
+ cand_left = 1;
} else { // No samples available
top[0] = left[-1] = (1 << (BIT_DEPTH - 1));
EXTEND_RIGHT(top, 1, 2 * size - 1);
@@ -278,7 +283,7 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
}
if (!cand_up) {
top[0] = left[-1];
- EXTEND_RIGHT(top, 1, size-1);
+ EXTEND_RIGHT(top, 1, size - 1);
}
if (!cand_up_right) {
EXTEND_RIGHT(top, size, size);
@@ -303,13 +308,13 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
// Filtering process
if (c_idx == 0 && mode != INTRA_DC && size != 4) {
int intra_hor_ver_dist_thresh[] = { 7, 1, 0 };
- int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
+ int min_dist_vert_hor = FFMIN(FFABS((int)(mode - 26U)),
FFABS((int)(mode - 10U)));
if (min_dist_vert_hor > intra_hor_ver_dist_thresh[log2_size - 3]) {
int threshold = 1 << (BIT_DEPTH - 5);
if (s->sps->sps_strong_intra_smoothing_enable_flag &&
log2_size == 5 &&
- FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
+ FFABS(top[-1] + top[63] - 2 * top[31]) < threshold &&
FFABS(left[-1] + left[63] - 2 * left[31]) < threshold) {
// We can't just overwrite values in top because it could be
// a pointer into src
@@ -328,9 +333,8 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
for (i = 2 * size - 2; i >= 0; i--)
filtered_left[i] = (left[i + 1] + 2 * left[i] +
left[i - 1] + 2) >> 2;
- filtered_top[-1] =
- filtered_left[-1] = (left[0] + 2 * left[-1] +
- top[0] + 2) >> 2;
+ filtered_top[-1] =
+ filtered_left[-1] = (left[0] + 2 * left[-1] + top[0] + 2) >> 2;
for (i = 2 * size - 2; i >= 0; i--)
filtered_top[i] = (top[i + 1] + 2 * top[i] +
top[i - 1] + 2) >> 2;
@@ -342,16 +346,17 @@ static void FUNC(intra_pred)(HEVCContext *s, int x0, int y0, int log2_size, int
switch (mode) {
case INTRA_PLANAR:
- s->hpc.pred_planar[log2_size - 2]((uint8_t*)src, (uint8_t*)top,
- (uint8_t*)left, stride);
+ s->hpc.pred_planar[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
+ (uint8_t *)left, stride);
break;
case INTRA_DC:
- s->hpc.pred_dc((uint8_t*)src, (uint8_t*)top,
- (uint8_t*)left, stride, log2_size, c_idx);
+ s->hpc.pred_dc((uint8_t *)src, (uint8_t *)top,
+ (uint8_t *)left, stride, log2_size, c_idx);
break;
default:
- s->hpc.pred_angular[log2_size - 2]((uint8_t*)src, (uint8_t*)top,
- (uint8_t*)left, stride, c_idx, mode);
+ s->hpc.pred_angular[log2_size - 2]((uint8_t *)src, (uint8_t *)top,
+ (uint8_t *)left, stride, c_idx,
+ mode);
break;
}
}
@@ -361,52 +366,52 @@ static void FUNC(pred_planar_0)(uint8_t *_src, const uint8_t *_top,
ptrdiff_t stride)
{
int x, y;
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
for (y = 0; y < 4; y++)
for (x = 0; x < 4; x++)
- POS(x, y) = ((3 - x) * left[y] + (x + 1) * top[4] +
- (3 - y) * top[x] + (y + 1) * left[4] + 4) >> 3;
+ POS(x, y) = ((3 - x) * left[y] + (x + 1) * top[4] +
+ (3 - y) * top[x] + (y + 1) * left[4] + 4) >> 3;
}
static void FUNC(pred_planar_1)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
int x, y;
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
for (y = 0; y < 8; y++)
for (x = 0; x < 8; x++)
- POS(x, y) = ((7 - x) * left[y] + (x + 1) * top[8] +
- (7 - y) * top[x] + (y + 1) * left[8] + 8) >> 4;
+ POS(x, y) = ((7 - x) * left[y] + (x + 1) * top[8] +
+ (7 - y) * top[x] + (y + 1) * left[8] + 8) >> 4;
}
static void FUNC(pred_planar_2)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
int x, y;
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
for (y = 0; y < 16; y++)
for (x = 0; x < 16; x++)
- POS(x, y) = ((15 - x) * left[y] + (x + 1) * top[16] +
- (15 - y) * top[x] + (y + 1) * left[16] + 16) >> 5;
+ POS(x, y) = ((15 - x) * left[y] + (x + 1) * top[16] +
+ (15 - y) * top[x] + (y + 1) * left[16] + 16) >> 5;
}
static void FUNC(pred_planar_3)(uint8_t *_src, const uint8_t *_top,
const uint8_t *_left, ptrdiff_t stride)
{
int x, y;
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
for (y = 0; y < 32; y++)
for (x = 0; x < 32; x++)
- POS(x, y) = ((31 - x) * left[y] + (x + 1) * top[32] +
- (31 - y) * top[x] + (y + 1) * left[32] + 32) >> 6;
+ POS(x, y) = ((31 - x) * left[y] + (x + 1) * top[32] +
+ (31 - y) * top[x] + (y + 1) * left[32] + 32) >> 6;
}
static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
@@ -414,11 +419,11 @@ static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
ptrdiff_t stride, int log2_size, int c_idx)
{
int i, j, x, y;
- int size = (1 << log2_size);
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
- int dc = size;
+ int size = (1 << log2_size);
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
+ int dc = size;
pixel4 a;
for (i = 0; i < size; i++)
dc += left[i] + top[i];
@@ -432,7 +437,7 @@ static void FUNC(pred_dc)(uint8_t *_src, const uint8_t *_top,
AV_WN4PA(&POS(j * 4, i), a);
if (c_idx == 0 && size < 32) {
- POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
+ POS(0, 0) = (left[0] + 2 * dc + top[0] + 2) >> 2;
for (x = 1; x < size; x++)
POS(x, 0) = (top[x] + 3 * dc + 2) >> 2;
for (y = 1; y < size; y++)
@@ -447,13 +452,13 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
int mode, int size)
{
int x, y;
- pixel *src = (pixel*)_src;
- const pixel *top = (const pixel*)_top;
- const pixel *left = (const pixel*)_left;
+ pixel *src = (pixel *)_src;
+ const pixel *top = (const pixel *)_top;
+ const pixel *left = (const pixel *)_left;
static const int intra_pred_angle[] = {
- 32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, -32,
- -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32
+ 32, 26, 21, 17, 13, 9, 5, 2, 0, -2, -5, -9, -13, -17, -21, -26, -32,
+ -26, -21, -17, -13, -9, -5, -2, 0, 2, 5, 9, 13, 17, 21, 26, 32
};
static const int inv_angle[] = {
-4096, -1638, -910, -630, -482, -390, -315, -256, -315, -390, -482,
@@ -472,7 +477,7 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
for (x = 0; x <= size; x++)
ref_tmp[x] = top[x - 1];
for (x = last; x <= -1; x++)
- ref_tmp[x] = left[-1 + ((x * inv_angle[mode-11] + 128) >> 8)];
+ ref_tmp[x] = left[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
ref = ref_tmp;
}
@@ -500,7 +505,7 @@ static av_always_inline void FUNC(pred_angular)(uint8_t *_src,
for (x = 0; x <= size; x++)
ref_tmp[x] = left[x - 1];
for (x = last; x <= -1; x++)
- ref_tmp[x] = top[-1 + ((x * inv_angle[mode-11] + 128) >> 8)];
+ ref_tmp[x] = top[-1 + ((x * inv_angle[mode - 11] + 128) >> 8)];
ref = ref_tmp;
}