Commit 3b4fa548 authored by Diego Biurrun's avatar Diego Biurrun

cavs: more K&R formatting cosmetics

parent c0085f94
...@@ -54,7 +54,7 @@ static const uint8_t tc_tab[64] = { ...@@ -54,7 +54,7 @@ static const uint8_t tc_tab[64] = {
}; };
/** mark block as unavailable, i.e. out of picture /** mark block as unavailable, i.e. out of picture
or not yet decoded */ * or not yet decoded */
static const cavs_vector un_mv = { 0, 0, 1, NOT_AVAIL }; static const cavs_vector un_mv = { 0, 0, 1, NOT_AVAIL };
static const int8_t left_modifier_l[8] = { 0, -1, 6, -1, -1, 7, 6, 7 }; static const int8_t left_modifier_l[8] = { 0, -1, 6, -1, -1, 7, 6, 7 };
...@@ -126,7 +126,7 @@ void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) ...@@ -126,7 +126,7 @@ void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type)
/* determine bs */ /* determine bs */
if (mb_type == I_8X8) if (mb_type == I_8X8)
memset(bs, 2, 8); memset(bs, 2, 8);
else{ else {
memset(bs, 0, 8); memset(bs, 0, 8);
if (ff_cavs_partition_flags[mb_type] & SPLITV) { if (ff_cavs_partition_flags[mb_type] & SPLITV) {
bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8); bs[2] = get_bs(&h->mv[MV_FWD_X0], &h->mv[MV_FWD_X1], mb_type > P_8X8);
...@@ -244,16 +244,15 @@ void ff_cavs_load_intra_pred_chroma(AVSContext *h) ...@@ -244,16 +244,15 @@ void ff_cavs_load_intra_pred_chroma(AVSContext *h)
} }
} }
static void intra_pred_vert(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_vert(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int y; int y;
uint64_t a = AV_RN64(&top[1]); uint64_t a = AV_RN64(&top[1]);
for (y = 0; y < 8; y++) { for (y = 0; y < 8; y++)
*((uint64_t *)(d + y * stride)) = a; *((uint64_t *)(d + y * stride)) = a;
}
} }
static void intra_pred_horiz(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_horiz(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int y; int y;
uint64_t a; uint64_t a;
...@@ -263,7 +262,7 @@ static void intra_pred_horiz(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -263,7 +262,7 @@ static void intra_pred_horiz(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
} }
} }
static void intra_pred_dc_128(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_dc_128(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int y; int y;
uint64_t a = 0x8080808080808080ULL; uint64_t a = 0x8080808080808080ULL;
...@@ -271,7 +270,7 @@ static void intra_pred_dc_128(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -271,7 +270,7 @@ static void intra_pred_dc_128(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
*((uint64_t *)(d + y * stride)) = a; *((uint64_t *)(d + y * stride)) = a;
} }
static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_plane(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y, ia; int x, y, ia;
int ih = 0; int ih = 0;
...@@ -279,7 +278,7 @@ static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -279,7 +278,7 @@ static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP; const uint8_t *cm = ff_cropTbl + MAX_NEG_CROP;
for (x = 0; x < 4; x++) { for (x = 0; x < 4; x++) {
ih += (x + 1) * (top [5 + x] - top [3 - x]); ih += (x + 1) * (top[5 + x] - top[3 - x]);
iv += (x + 1) * (left[5 + x] - left[3 - x]); iv += (x + 1) * (left[5 + x] - left[3 - x]);
} }
ia = (top[8] + left[8]) << 4; ia = (top[8] + left[8]) << 4;
...@@ -290,10 +289,10 @@ static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -290,10 +289,10 @@ static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
d[y * stride + x] = cm[(ia + (x - 3) * ih + (y - 3) * iv + 16) >> 5]; d[y * stride + x] = cm[(ia + (x - 3) * ih + (y - 3) * iv + 16) >> 5];
} }
#define LOWPASS(ARRAY,INDEX) \ #define LOWPASS(ARRAY, INDEX) \
((ARRAY[(INDEX) - 1] + 2 * ARRAY[(INDEX)] + ARRAY[(INDEX) + 1] + 2) >> 2) ((ARRAY[(INDEX) - 1] + 2 * ARRAY[(INDEX)] + ARRAY[(INDEX) + 1] + 2) >> 2)
static void intra_pred_lp(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_lp(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y; int x, y;
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
...@@ -301,7 +300,7 @@ static void intra_pred_lp(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -301,7 +300,7 @@ static void intra_pred_lp(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
d[y * stride + x] = (LOWPASS(top, x + 1) + LOWPASS(left, y + 1)) >> 1; d[y * stride + x] = (LOWPASS(top, x + 1) + LOWPASS(left, y + 1)) >> 1;
} }
static void intra_pred_down_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_down_left(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y; int x, y;
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
...@@ -309,7 +308,7 @@ static void intra_pred_down_left(uint8_t *d,uint8_t *top,uint8_t *left,int strid ...@@ -309,7 +308,7 @@ static void intra_pred_down_left(uint8_t *d,uint8_t *top,uint8_t *left,int strid
d[y * stride + x] = (LOWPASS(top, x + y + 2) + LOWPASS(left, x + y + 2)) >> 1; d[y * stride + x] = (LOWPASS(top, x + y + 2) + LOWPASS(left, x + y + 2)) >> 1;
} }
static void intra_pred_down_right(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_down_right(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y; int x, y;
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
...@@ -322,7 +321,7 @@ static void intra_pred_down_right(uint8_t *d,uint8_t *top,uint8_t *left,int stri ...@@ -322,7 +321,7 @@ static void intra_pred_down_right(uint8_t *d,uint8_t *top,uint8_t *left,int stri
d[y * stride + x] = LOWPASS(left, y - x); d[y * stride + x] = LOWPASS(left, y - x);
} }
static void intra_pred_lp_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_lp_left(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y; int x, y;
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
...@@ -330,7 +329,7 @@ static void intra_pred_lp_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride) ...@@ -330,7 +329,7 @@ static void intra_pred_lp_left(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
d[y * stride + x] = LOWPASS(left, y + 1); d[y * stride + x] = LOWPASS(left, y + 1);
} }
static void intra_pred_lp_top(uint8_t *d,uint8_t *top,uint8_t *left,int stride) static void intra_pred_lp_top(uint8_t *d, uint8_t *top, uint8_t *left, int stride)
{ {
int x, y; int x, y;
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
...@@ -383,8 +382,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height, ...@@ -383,8 +382,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
qpel_mc_func *qpix_op, qpel_mc_func *qpix_op,
h264_chroma_mc_func chroma_op, cavs_vector *mv) h264_chroma_mc_func chroma_op, cavs_vector *mv)
{ {
const int mx = mv->x + src_x_offset*8; const int mx = mv->x + src_x_offset * 8;
const int my = mv->y + src_y_offset*8; const int my = mv->y + src_y_offset * 8;
const int luma_xy = (mx & 3) + ((my & 3) << 2); const int luma_xy = (mx & 3) + ((my & 3) << 2);
uint8_t *src_y = pic->data[0] + (mx >> 2) + (my >> 2) * h->l_stride; uint8_t *src_y = pic->data[0] + (mx >> 2) + (my >> 2) * h->l_stride;
uint8_t *src_cb = pic->data[1] + (mx >> 3) + (my >> 3) * h->c_stride; uint8_t *src_cb = pic->data[1] + (mx >> 3) + (my >> 3) * h->c_stride;
...@@ -455,9 +454,9 @@ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta, ...@@ -455,9 +454,9 @@ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta,
qpel_mc_func *qpix_op = qpix_put; qpel_mc_func *qpix_op = qpix_put;
h264_chroma_mc_func chroma_op = chroma_put; h264_chroma_mc_func chroma_op = chroma_put;
dest_y += 2 * x_offset + 2 * y_offset*h->l_stride; dest_y += x_offset * 2 + y_offset * h->l_stride * 2;
dest_cb += x_offset + y_offset*h->c_stride; dest_cb += x_offset + y_offset * h->c_stride;
dest_cr += x_offset + y_offset*h->c_stride; dest_cr += x_offset + y_offset * h->c_stride;
x_offset += 8 * h->mbx; x_offset += 8 * h->mbx;
y_offset += 8 * h->mby; y_offset += 8 * h->mby;
...@@ -475,7 +474,7 @@ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta, ...@@ -475,7 +474,7 @@ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta,
AVFrame *ref = h->DPB[0].f; AVFrame *ref = h->DPB[0].f;
mc_dir_part(h, ref, chroma_height, delta, 1, mc_dir_part(h, ref, chroma_height, delta, 1,
dest_y, dest_cb, dest_cr, x_offset, y_offset, dest_y, dest_cb, dest_cr, x_offset, y_offset,
qpix_op, chroma_op, mv+MV_BWD_OFFS); qpix_op, chroma_op, mv + MV_BWD_OFFS);
} }
} }
...@@ -573,7 +572,7 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC, ...@@ -573,7 +572,7 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
mvP->ref = ref; mvP->ref = ref;
mvP->dist = h->dist[mvP->ref]; mvP->dist = h->dist[mvP->ref];
if (mvC->ref == NOT_AVAIL) if (mvC->ref == NOT_AVAIL)
mvC = &h->mv[nP-5]; // set to top-left (mvD) mvC = &h->mv[nP - 5]; // set to top-left (mvD)
if (mode == MV_PRED_PSKIP && if (mode == MV_PRED_PSKIP &&
(mvA->ref == NOT_AVAIL || (mvA->ref == NOT_AVAIL ||
mvB->ref == NOT_AVAIL || mvB->ref == NOT_AVAIL ||
...@@ -604,7 +603,7 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC, ...@@ -604,7 +603,7 @@ void ff_cavs_mv(AVSContext *h, enum cavs_mv_loc nP, enum cavs_mv_loc nC,
mvP->x += get_se_golomb(&h->gb); mvP->x += get_se_golomb(&h->gb);
mvP->y += get_se_golomb(&h->gb); mvP->y += get_se_golomb(&h->gb);
} }
set_mvs(mvP,size); set_mvs(mvP, size);
} }
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
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