prettyprinting cosmetics

Originally committed as revision 15682 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Diego Biurrun 2008-10-24 21:41:27 +00:00
parent 75f2c20983
commit f94036f159
4 changed files with 389 additions and 378 deletions

View File

@ -196,10 +196,10 @@ static av_cold int dvvideo_init(AVCodecContext *avctx)
if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0) if (dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size != 0)
continue; continue;
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc = dv_vlc_bits[i] << dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].vlc =
(!!dv_vlc_level[i]); dv_vlc_bits[i] << (!!dv_vlc_level[i]);
dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size = dv_vlc_len[i] + dv_vlc_map[dv_vlc_run[i]][dv_vlc_level[i]].size =
(!!dv_vlc_level[i]); dv_vlc_len[i] + (!!dv_vlc_level[i]);
} }
for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) { for (i = 0; i < DV_VLC_MAP_RUN_SIZE; i++) {
#ifdef DV_CODEC_TINY_TARGET #ifdef DV_CODEC_TINY_TARGET
@ -621,11 +621,11 @@ typedef struct EncBlockInfo {
uint32_t partial_bit_buffer; /* we can't use uint16_t here */ uint32_t partial_bit_buffer; /* we can't use uint16_t here */
} EncBlockInfo; } EncBlockInfo;
static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitContext* pb_pool, static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi,
PutBitContext* pb_pool,
PutBitContext* pb_end) PutBitContext* pb_end)
{ {
int prev; int prev, bits_left;
int bits_left;
PutBitContext* pb = pb_pool; PutBitContext* pb = pb_pool;
int size = bi->partial_bit_count; int size = bi->partial_bit_count;
uint32_t vlc = bi->partial_bit_buffer; uint32_t vlc = bi->partial_bit_buffer;
@ -665,7 +665,8 @@ static av_always_inline PutBitContext* dv_encode_ac(EncBlockInfo* bi, PutBitCont
} }
static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi, static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
const uint8_t* zigzag_scan, const int *weight, int bias) const uint8_t* zigzag_scan,
const int *weight, int bias)
{ {
int i, area; int i, area;
/* We offer two different methods for class number assignment: the /* We offer two different methods for class number assignment: the
@ -701,7 +702,8 @@ static av_always_inline void dv_set_class_number(DCTELEM* blk, EncBlockInfo* bi,
AND the 2x doubling of the weights */ AND the 2x doubling of the weights */
level = (FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4); level = (FFABS(level) * weight[i] + (1 << (dv_weight_bits+3))) >> (dv_weight_bits+4);
bi->mb[i] = level; bi->mb[i] = level;
if(level>max) max= level; if (level > max)
max = level;
bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, level); bi->bit_size[area] += dv_rl2vlc_size(i - prev - 1, level);
bi->next[prev]= i; bi->next[prev]= i;
prev = i; prev = i;
@ -1002,7 +1004,9 @@ static int dv_decode_mt(AVCodecContext *avctx, void* sl)
(DV_PROFILE_IS_720p50(s->sys) && seq > 9)) (DV_PROFILE_IS_720p50(s->sys) && seq > 9))
return 0; return 0;
dv_decode_video_segment(s, &s->buf[(seq*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset], dv_decode_video_segment(s, &s->buf[(seq * 6 + (chan_slice / 3)
+ chan_slice * 5 + 7)
* 80 + chan_offset],
&s->sys->video_place[slice * 5]); &s->sys->video_place[slice * 5]);
return 0; return 0;
} }
@ -1022,7 +1026,9 @@ static int dv_encode_mt(AVCodecContext *avctx, void* sl)
/* byte offset of this channel's data */ /* byte offset of this channel's data */
int chan_offset = chan * s->sys->difseg_size * 150 * 80; int chan_offset = chan * s->sys->difseg_size * 150 * 80;
dv_encode_video_segment(s, &s->buf[((chan_slice/27)*6+(chan_slice/3)+chan_slice*5+7)*80 + chan_offset], dv_encode_video_segment(s, &s->buf[((chan_slice / 27) * 6 + (chan_slice / 3)
+ chan_slice * 5 + 7)
* 80 + chan_offset],
&s->sys->video_place[slice * 5]); &s->sys->video_place[slice * 5]);
return 0; return 0;
} }
@ -1072,7 +1078,8 @@ static int dvvideo_decode_frame(AVCodecContext *avctx,
#endif /* CONFIG_DVVIDEO_DECODER */ #endif /* CONFIG_DVVIDEO_DECODER */
static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c, uint8_t* buf) static inline int dv_write_pack(enum dv_pack_type pack_id, DVVideoContext *c,
uint8_t* buf)
{ {
/* /*
* Here's what SMPTE314M says about these two: * Here's what SMPTE314M says about these two:

View File

@ -6360,7 +6360,8 @@ enum dv_pack_type {
#define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1)) #define DV_PROFILE_IS_1080i50(p) (((p)->video_stype == 0x14) && ((p)->dsf == 1))
#define DV_PROFILE_IS_720p50(p) (((p)->video_stype == 0x18) && ((p)->dsf == 1)) #define DV_PROFILE_IS_720p50(p) (((p)->video_stype == 0x18) && ((p)->dsf == 1))
/* minimum number of bytes to read from a DV stream in order to determine the profile */ /* minimum number of bytes to read from a DV stream in order to
determine the profile */
#define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */ #define DV_PROFILE_BYTES (6*80) /* 6 DIF blocks */
/** /**
@ -6398,15 +6399,17 @@ static const DVprofile* dv_codec_profile(AVCodecContext* codec)
int i; int i;
for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++) for (i=0; i<FF_ARRAY_ELEMS(dv_profiles); i++)
if (codec->height == dv_profiles[i].height && codec->pix_fmt == dv_profiles[i].pix_fmt && if (codec->height == dv_profiles[i].height &&
codec->pix_fmt == dv_profiles[i].pix_fmt &&
codec->width == dv_profiles[i].width) codec->width == dv_profiles[i].width)
return &dv_profiles[i]; return &dv_profiles[i];
return NULL; return NULL;
} }
static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num, uint8_t seq_num, static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num,
uint8_t dif_num, uint8_t* buf) uint8_t seq_num, uint8_t dif_num,
uint8_t* buf)
{ {
buf[0] = (uint8_t)t; /* Section type */ buf[0] = (uint8_t)t; /* Section type */
buf[1] = (seq_num << 4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */ buf[1] = (seq_num << 4) | /* DIF seq number 0-9 for 525/60; 0-11 for 625/50 */

View File

@ -122,7 +122,7 @@ static int dv_extract_audio(uint8_t* frame, uint8_t* ppcm[4],
half_ch = sys->difseg_size / 2; half_ch = sys->difseg_size / 2;
/* We work with 720p frames split in half, thus even frames have /* We work with 720p frames split in half, thus even frames have
* channels 0,1 and odd 2,3 */ * channels 0,1 and odd 2,3. */
ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0; ipcm = (sys->height == 720 && !(frame[1] & 0x0C)) ? 2 : 0;
pcm = ppcm[ipcm++]; pcm = ppcm[ipcm++];
@ -242,7 +242,8 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
if (c->sys) { if (c->sys) {
avctx = c->vst->codec; avctx = c->vst->codec;
av_set_pts_info(c->vst, 64, c->sys->time_base.num, c->sys->time_base.den); av_set_pts_info(c->vst, 64, c->sys->time_base.num,
c->sys->time_base.den);
avctx->time_base= c->sys->time_base; avctx->time_base= c->sys->time_base;
if (!avctx->width){ if (!avctx->width){
avctx->width = c->sys->width; avctx->width = c->sys->width;

View File

@ -77,8 +77,8 @@ static int dv_write_pack(enum dv_pack_type pack_id, DVMuxContext *c, uint8_t* bu
buf[0] = (uint8_t)pack_id; buf[0] = (uint8_t)pack_id;
switch (pack_id) { switch (pack_id) {
case dv_timecode: case dv_timecode:
ct = (time_t)av_rescale_rnd(c->frames, c->sys->time_base.num, c->sys->time_base.den, ct = (time_t)av_rescale_rnd(c->frames, c->sys->time_base.num,
AV_ROUND_DOWN); c->sys->time_base.den, AV_ROUND_DOWN);
brktimegm(ct, &tc); brktimegm(ct, &tc);
/* /*
* LTC drop-frame frame counter drops two frames (0 and 1) every * LTC drop-frame frame counter drops two frames (0 and 1) every