Commit 213e6067 authored by Diego Biurrun's avatar Diego Biurrun

Replace av_unused attributes by block structures

This is more portable and avoids warnings with compilers that do not
properly support av_unused.
parent 096a1d5b
...@@ -68,7 +68,6 @@ static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data) ...@@ -68,7 +68,6 @@ static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data)
FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
FLOAT tmp10, tmp11, tmp12, tmp13; FLOAT tmp10, tmp11, tmp12, tmp13;
FLOAT z2, z4, z11, z13; FLOAT z2, z4, z11, z13;
FLOAT av_unused z5;
int i; int i;
for (i=0; i<8*8; i+=8) { for (i=0; i<8*8; i+=8) {
...@@ -99,9 +98,12 @@ static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data) ...@@ -99,9 +98,12 @@ static av_always_inline void row_fdct(FLOAT temp[64], int16_t *data)
tmp6 += tmp7; tmp6 += tmp7;
#if 0 #if 0
z5= (tmp4 - tmp6) * A5; {
z2= tmp4*A2 + z5; FLOAT z5;
z4= tmp6*A4 + z5; z5 = (tmp4 - tmp6) * A5;
z2 = tmp4 * A2 + z5;
z4 = tmp6 * A4 + z5;
}
#else #else
z2= tmp4*(A2+A5) - tmp6*A5; z2= tmp4*(A2+A5) - tmp6*A5;
z4= tmp6*(A4-A5) + tmp4*A5; z4= tmp6*(A4-A5) + tmp4*A5;
...@@ -123,7 +125,6 @@ void ff_faandct(int16_t *data) ...@@ -123,7 +125,6 @@ void ff_faandct(int16_t *data)
FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7; FLOAT tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
FLOAT tmp10, tmp11, tmp12, tmp13; FLOAT tmp10, tmp11, tmp12, tmp13;
FLOAT z2, z4, z11, z13; FLOAT z2, z4, z11, z13;
FLOAT av_unused z5;
FLOAT temp[64]; FLOAT temp[64];
int i; int i;
...@@ -159,9 +160,12 @@ void ff_faandct(int16_t *data) ...@@ -159,9 +160,12 @@ void ff_faandct(int16_t *data)
tmp6 += tmp7; tmp6 += tmp7;
#if 0 #if 0
z5= (tmp4 - tmp6) * A5; {
z2= tmp4*A2 + z5; FLOAT z5;
z4= tmp6*A4 + z5; z5 = (tmp4 - tmp6) * A5;
z2 = tmp4 * A2 + z5;
z4 = tmp6 * A4 + z5;
}
#else #else
z2= tmp4*(A2+A5) - tmp6*A5; z2= tmp4*(A2+A5) - tmp6*A5;
z4= tmp6*(A4-A5) + tmp4*A5; z4= tmp6*(A4-A5) + tmp4*A5;
......
...@@ -49,7 +49,6 @@ B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8, ...@@ -49,7 +49,6 @@ B7*B0/8, B7*B1/8, B7*B2/8, B7*B3/8, B7*B4/8, B7*B5/8, B7*B6/8, B7*B7/8,
static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){ static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int stride, int x, int y, int type){
int i; int i;
FLOAT av_unused tmp0;
FLOAT s04, d04, s17, d17, s26, d26, s53, d53; FLOAT s04, d04, s17, d17, s26, d26, s53, d53;
FLOAT os07, os16, os25, os34; FLOAT os07, os16, os25, os34;
FLOAT od07, od16, od25, od34; FLOAT od07, od16, od25, od34;
...@@ -64,9 +63,12 @@ static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int s ...@@ -64,9 +63,12 @@ static inline void p8idct(int16_t data[64], FLOAT temp[64], uint8_t *dest, int s
od25= (s17 - s53)*(2*A4); od25= (s17 - s53)*(2*A4);
#if 0 //these 2 are equivalent #if 0 //these 2 are equivalent
tmp0= (d17 + d53)*(2*A2); {
od34= d17*( 2*B6) - tmp0; FLOAT tmp0;
od16= d53*(-2*B2) + tmp0; tmp0 = (d17 + d53) * (2 * A2);
od34 = d17 * (2 * B6) - tmp0;
od16 = d53 * (-2 * B2) + tmp0;
}
#else #else
od34= d17*(2*(B6-A2)) - d53*(2*A2); od34= d17*(2*(B6-A2)) - d53*(2*A2);
od16= d53*(2*(A2-B2)) + d17*(2*A2); od16= d53*(2*(A2-B2)) + d17*(2*A2);
......
...@@ -704,7 +704,6 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint ...@@ -704,7 +704,6 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
const int mb_type = h->cur_pic.mb_type[mb_xy]; const int mb_type = h->cur_pic.mb_type[mb_xy];
const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4; const int mvy_limit = IS_INTERLACED(mb_type) ? 2 : 4;
int first_vertical_edge_done = 0; int first_vertical_edge_done = 0;
av_unused int dir;
int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY)); int chroma = !(CONFIG_GRAY && (h->flags&CODEC_FLAG_GRAY));
int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8); int qp_bd_offset = 6 * (h->sps.bit_depth_luma - 8);
int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset; int a = 52 + h->slice_alpha_c0_offset - qp_bd_offset;
...@@ -815,8 +814,14 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint ...@@ -815,8 +814,14 @@ void ff_h264_filter_mb( H264Context *h, int mb_x, int mb_y, uint8_t *img_y, uint
} }
#if CONFIG_SMALL #if CONFIG_SMALL
for( dir = 0; dir < 2; dir++ ) {
filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, dir ? 0 : first_vertical_edge_done, a, b, chroma, dir); int dir;
for (dir = 0; dir < 2; dir++)
filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize,
uvlinesize, mb_xy, mb_type, mvy_limit,
dir ? 0 : first_vertical_edge_done, a, b,
chroma, dir);
}
#else #else
filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, a, b, chroma, 0); filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, first_vertical_edge_done, a, b, chroma, 0);
filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, a, b, chroma, 1); filter_mb_dir(h, mb_x, mb_y, img_y, img_cb, img_cr, linesize, uvlinesize, mb_xy, mb_type, mvy_limit, 0, a, b, chroma, 1);
......
...@@ -115,7 +115,6 @@ static inline void refill(RangeCoder *c) ...@@ -115,7 +115,6 @@ static inline void refill(RangeCoder *c)
static inline int get_rac(RangeCoder *c, uint8_t *const state) static inline int get_rac(RangeCoder *c, uint8_t *const state)
{ {
int range1 = (c->range * (*state)) >> 8; int range1 = (c->range * (*state)) >> 8;
int av_unused one_mask;
c->range -= range1; c->range -= range1;
#if 1 #if 1
...@@ -131,13 +130,14 @@ static inline int get_rac(RangeCoder *c, uint8_t *const state) ...@@ -131,13 +130,14 @@ static inline int get_rac(RangeCoder *c, uint8_t *const state)
return 1; return 1;
} }
#else #else
one_mask = (c->range - c->low - 1) >> 31; {
int one_mask one_mask = (c->range - c->low - 1) >> 31;
c->low -= c->range & one_mask; c->low -= c->range & one_mask;
c->range += (range1 - c->range) & one_mask; c->range += (range1 - c->range) & one_mask;
*state = c->zero_state[(*state) + (256 & one_mask)];
*state = c->zero_state[(*state) + (256 & one_mask)];
}
refill(c); refill(c);
return one_mask & 1; return one_mask & 1;
......
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