cavs: cosmetics, reformat top part

This commit is contained in:
Anton Khirnov 2012-12-27 14:16:25 +01:00
parent 185c2ef849
commit 64bb3fa6b7

View File

@ -67,7 +67,8 @@ static const int8_t top_modifier_c[7] = { 4, 1, -1, -1, 4, 6, 6 };
*
****************************************************************************/
static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b) {
static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b)
{
if ((mvP->ref == REF_INTRA) || (mvQ->ref == REF_INTRA))
return 2;
if ((abs(mvP->x - mvQ->x) >= 4) || (abs(mvP->y - mvQ->y) >= 4))
@ -101,7 +102,8 @@ static inline int get_bs(cavs_vector *mvP, cavs_vector *mvQ, int b) {
* ---------
*
*/
void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) {
void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type)
{
uint8_t bs[8];
int qp_avg, alpha, beta, tc;
int i;
@ -149,8 +151,7 @@ void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) {
qp_avg = h->qp;
SET_PARAMS;
h->cdsp.cavs_filter_lv(h->cy + 8, h->l_stride, alpha, beta, tc, bs[2], bs[3]);
h->cdsp.cavs_filter_lh(h->cy + 8*h->l_stride,h->l_stride,alpha,beta,tc,
bs[6],bs[7]);
h->cdsp.cavs_filter_lh(h->cy + 8 * h->l_stride, h->l_stride, alpha, beta, tc, bs[6], bs[7]);
if (h->flags & B_AVAIL) {
qp_avg = (h->qp + h->top_qp[h->mbx] + 1) >> 1;
@ -174,7 +175,8 @@ void ff_cavs_filter(AVSContext *h, enum cavs_mb mb_type) {
****************************************************************************/
void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top,
uint8_t **left, int block) {
uint8_t **left, int block)
{
int i;
switch (block) {
@ -223,7 +225,8 @@ void ff_cavs_load_intra_pred_luma(AVSContext *h, uint8_t *top,
}
}
void ff_cavs_load_intra_pred_chroma(AVSContext *h) {
void ff_cavs_load_intra_pred_chroma(AVSContext *h)
{
/* extend borders by one pixel */
h->left_border_u[9] = h->left_border_u[8];
h->left_border_v[9] = h->left_border_v[8];
@ -240,7 +243,8 @@ 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++) {
@ -248,7 +252,8 @@ static void intra_pred_vert(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) {
static void intra_pred_horiz(uint8_t *d,uint8_t *top,uint8_t *left,int stride)
{
int y;
uint64_t a;
for (y = 0; y < 8; y++) {
@ -257,14 +262,16 @@ 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;
for (y = 0; y < 8; y++)
*((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;
int iv = 0;
@ -285,21 +292,24 @@ static void intra_pred_plane(uint8_t *d,uint8_t *top,uint8_t *left,int stride) {
#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++)
for (x = 0; x < 8; x++)
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++)
for (x = 0; x < 8; x++)
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++)
for (x = 0; x < 8; x++)
@ -311,14 +321,16 @@ 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++)
for (x = 0; x < 8; x++)
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++)
for (x = 0; x < 8; x++)
@ -336,7 +348,8 @@ static inline void modify_pred(const int8_t *mod_table, int *mode)
}
}
void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv) {
void ff_cavs_modify_mb_i(AVSContext *h, int *pred_mode_uv)
{
/* save pred modes before they get modified */
h->pred_mode_Y[3] = h->pred_mode_Y[5];
h->pred_mode_Y[6] = h->pred_mode_Y[8];