Commit b18c68ad authored by Kostya Shishkov's avatar Kostya Shishkov Committed by Diego Biurrun

vc1: K&R formatting cosmetics

Signed-off-by: 's avatarDiego Biurrun <diego@biurrun.de>
parent 492bd1a2
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
/** Markers used in VC-1 AP frame data */ /** Markers used in VC-1 AP frame data */
//@{ //@{
enum VC1Code{ enum VC1Code {
VC1_CODE_RES0 = 0x00000100, VC1_CODE_RES0 = 0x00000100,
VC1_CODE_ENDOFSEQ = 0x0000010A, VC1_CODE_ENDOFSEQ = 0x0000010A,
VC1_CODE_SLICE, VC1_CODE_SLICE,
...@@ -133,10 +133,10 @@ enum TransformTypes { ...@@ -133,10 +133,10 @@ enum TransformTypes {
TT_8X8, TT_8X8,
TT_8X4_BOTTOM, TT_8X4_BOTTOM,
TT_8X4_TOP, TT_8X4_TOP,
TT_8X4, //Both halves TT_8X4, // both halves
TT_4X8_RIGHT, TT_4X8_RIGHT,
TT_4X8_LEFT, TT_4X8_LEFT,
TT_4X8, //Both halves TT_4X8, // both halves
TT_4X4 TT_4X4
}; };
//@} //@}
...@@ -230,10 +230,10 @@ typedef struct VC1Context{ ...@@ -230,10 +230,10 @@ typedef struct VC1Context{
int k_y; ///< Number of bits for MVs (depends on MV range) int k_y; ///< Number of bits for MVs (depends on MV range)
int range_x, range_y; ///< MV range int range_x, range_y; ///< MV range
uint8_t pq, altpq; ///< Current/alternate frame quantizer scale uint8_t pq, altpq; ///< Current/alternate frame quantizer scale
uint8_t zz_8x8[4][64];///< Zigzag table for TT_8x8, permuted for IDCT uint8_t zz_8x8[4][64]; ///< Zigzag table for TT_8x8, permuted for IDCT
int left_blk_sh, top_blk_sh; ///< Either 3 or 0, positions of l/t in blk[] int left_blk_sh, top_blk_sh; ///< Either 3 or 0, positions of l/t in blk[]
const uint8_t* zz_8x4;///< Zigzag scan table for TT_8x4 coding mode const uint8_t* zz_8x4; ///< Zigzag scan table for TT_8x4 coding mode
const uint8_t* zz_4x8;///< Zigzag scan table for TT_4x8 coding mode const uint8_t* zz_4x8; ///< Zigzag scan table for TT_4x8 coding mode
/** pquant parameters */ /** pquant parameters */
//@{ //@{
uint8_t dquantfrm; uint8_t dquantfrm;
...@@ -284,7 +284,7 @@ typedef struct VC1Context{ ...@@ -284,7 +284,7 @@ typedef struct VC1Context{
int dmb_is_raw; ///< direct mb plane is raw int dmb_is_raw; ///< direct mb plane is raw
int fmb_is_raw; ///< forward mb plane is raw int fmb_is_raw; ///< forward mb plane is raw
int skip_is_raw; ///< skip mb plane is not coded int skip_is_raw; ///< skip mb plane is not coded
uint8_t luty[256], lutuv[256];///< lookup tables used for intensity compensation uint8_t luty[256], lutuv[256]; ///< lookup tables used for intensity compensation
int use_ic; ///< use intensity compensation in B-frames int use_ic; ///< use intensity compensation in B-frames
int rnd; ///< rounding control int rnd; ///< rounding control
...@@ -378,7 +378,7 @@ typedef struct VC1Context{ ...@@ -378,7 +378,7 @@ typedef struct VC1Context{
uint32_t *cbp_base, *cbp; uint32_t *cbp_base, *cbp;
uint8_t *is_intra_base, *is_intra; uint8_t *is_intra_base, *is_intra;
int16_t (*luma_mv_base)[2], (*luma_mv)[2]; int16_t (*luma_mv_base)[2], (*luma_mv)[2];
uint8_t bfraction_lut_index;///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[]) uint8_t bfraction_lut_index; ///< Index for BFRACTION value (see Table 40, reproduced into ff_vc1_bfraction_lut[])
uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element) uint8_t broken_link; ///< Broken link flag (BROKEN_LINK syntax element)
uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element) uint8_t closed_entry; ///< Closed entry point flag (CLOSED_ENTRY syntax element)
...@@ -394,11 +394,12 @@ static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, cons ...@@ -394,11 +394,12 @@ static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, cons
{ {
uint32_t mrk = 0xFFFFFFFF; uint32_t mrk = 0xFFFFFFFF;
if(end-src < 4) return end; if (end-src < 4)
while(src < end){ return end;
while (src < end) {
mrk = (mrk << 8) | *src++; mrk = (mrk << 8) | *src++;
if(IS_MARKER(mrk)) if (IS_MARKER(mrk))
return src-4; return src - 4;
} }
return end; return end;
} }
...@@ -407,12 +408,13 @@ static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, ui ...@@ -407,12 +408,13 @@ static av_always_inline int vc1_unescape_buffer(const uint8_t *src, int size, ui
{ {
int dsize = 0, i; int dsize = 0, i;
if(size < 4){ if (size < 4) {
for(dsize = 0; dsize < size; dsize++) *dst++ = *src++; for (dsize = 0; dsize < size; dsize++)
*dst++ = *src++;
return size; return size;
} }
for(i = 0; i < size; i++, src++) { for (i = 0; i < size; i++, src++) {
if(src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) { if (src[0] == 3 && i >= 2 && !src[-1] && !src[-2] && i < size-1 && src[1] < 4) {
dst[dsize++] = src[1]; dst[dsize++] = src[1];
src++; src++;
i++; i++;
......
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