Commit 3a8b52c0 authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '3b4fa548'

* commit '3b4fa548':
  cavs: more K&R formatting cosmetics
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 12e98210 3b4fa548
......@@ -54,7 +54,7 @@ static const uint8_t tc_tab[64] = {
};
/** 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 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)
/* determine bs */
if (mb_type == I_8X8)
memset(bs, 2, 8);
else{
else {
memset(bs, 0, 8);
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);
......@@ -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;
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;
}
}
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;
uint64_t a;
......@@ -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;
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)
*((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 ih = 0;
......@@ -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;
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]);
}
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)
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)
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;
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)
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;
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
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;
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
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;
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)
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;
for (y = 0; y < 8; y++)
......@@ -383,8 +382,8 @@ static inline void mc_dir_part(AVSContext *h, AVFrame *pic, int chroma_height,
qpel_mc_func *qpix_op,
h264_chroma_mc_func chroma_op, cavs_vector *mv)
{
const int mx = mv->x + src_x_offset*8;
const int my = mv->y + src_y_offset*8;
const int mx = mv->x + src_x_offset * 8;
const int my = mv->y + src_y_offset * 8;
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_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,
qpel_mc_func *qpix_op = qpix_put;
h264_chroma_mc_func chroma_op = chroma_put;
dest_y += 2 * x_offset + 2 * y_offset*h->l_stride;
dest_cb += x_offset + y_offset*h->c_stride;
dest_cr += x_offset + y_offset*h->c_stride;
dest_y += x_offset * 2 + y_offset * h->l_stride * 2;
dest_cb += x_offset + y_offset * h->c_stride;
dest_cr += x_offset + y_offset * h->c_stride;
x_offset += 8 * h->mbx;
y_offset += 8 * h->mby;
......@@ -475,7 +474,7 @@ static inline void mc_part_std(AVSContext *h, int chroma_height, int delta,
AVFrame *ref = h->DPB[0].f;
mc_dir_part(h, ref, chroma_height, delta, 1,
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,
mvP->ref = ref;
mvP->dist = h->dist[mvP->ref];
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 &&
(mvA->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,
mvP->x += 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