Browse Source

simplifying the code as per Michael's suggestion

Originally committed as revision 15577 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Roman Shaposhnik 16 years ago
parent
commit
c9b0b38f45
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      libavcodec/dv.c
  2. +2
    -2
      libavformat/dv.c

+ 1
- 1
libavcodec/dv.c View File

@@ -492,7 +492,7 @@ static inline void dv_decode_video_segment(DVVideoContext *s,
mb_x = v & 0xff; mb_x = v & 0xff;
mb_y = v >> 8; mb_y = v >> 8;
/* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */ /* We work with 720p frames split in half. The odd half-frame (chan==2,3) is displaced :-( */
if (s->sys->height == 720 && ((s->buf[1]>>2)&0x3) == 0) {
if (s->sys->height == 720 && !(s->buf[1]&0x0C)) {
mb_y -= (mb_y>17)?18:-72; /* shifting the Y coordinate down by 72/2 macroblocks */ mb_y -= (mb_y>17)?18:-72; /* shifting the Y coordinate down by 72/2 macroblocks */
} }




+ 2
- 2
libavformat/dv.c 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 channels 0,1 and odd 2,3 */ /* We work with 720p frames split in half, thus even frames have channels 0,1 and odd 2,3 */
ipcm = (sys->height == 720 && ((frame[1]>>2)&0x3) == 0)?2:0;
ipcm = (sys->height == 720 && !(frame[1]&0x0C))?2:0;
pcm = ppcm[ipcm++]; pcm = ppcm[ipcm++];


/* for each DIF channel */ /* for each DIF channel */
@@ -339,7 +339,7 @@ int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,


/* We work with 720p frames split in half, thus even frames have channels 0,1 and odd 2,3 */ /* We work with 720p frames split in half, thus even frames have channels 0,1 and odd 2,3 */
if (c->sys->height == 720) { if (c->sys->height == 720) {
if (((buf[1]>>2)&0x3))
if (buf[1]&0x0C)
c->audio_pkt[2].size = c->audio_pkt[3].size = 0; c->audio_pkt[2].size = c->audio_pkt[3].size = 0;
else else
c->audio_pkt[0].size = c->audio_pkt[1].size = 0; c->audio_pkt[0].size = c->audio_pkt[1].size = 0;


Loading…
Cancel
Save