comparison mxfenc.c @ 4939:d10d934600db libavformat

reindent
author bcoudurier
date Fri, 15 May 2009 04:44:37 +0000
parents d7c5a47fe9c2
children 3be97dd76d2c
comparison
equal deleted inserted replaced
4938:d7c5a47fe9c2 4939:d10d934600db
1314 } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) { // pict coding ext 1314 } else if (i + 5 < pkt->size && (pkt->data[i+1] & 0xf0) == 0x80) { // pict coding ext
1315 sc->interlaced = !(pkt->data[i+5] & 0x80); // progressive frame 1315 sc->interlaced = !(pkt->data[i+5] & 0x80); // progressive frame
1316 break; 1316 break;
1317 } 1317 }
1318 } else if (c == 0x1b8) { // gop 1318 } else if (c == 0x1b8) { // gop
1319 if (pkt->data[i+4]>>6 & 0x01) // closed 1319 if (pkt->data[i+4]>>6 & 0x01) // closed
1320 *flags |= 0x80; // random access 1320 *flags |= 0x80; // random access
1321 if (!mxf->header_written) { 1321 if (!mxf->header_written) {
1322 unsigned hours = (pkt->data[i+1]>>2) & 0x1f; 1322 unsigned hours = (pkt->data[i+1]>>2) & 0x1f;
1323 unsigned minutes = ((pkt->data[i+1] & 0x03) << 4) | (pkt->data[i+2]>>4); 1323 unsigned minutes = ((pkt->data[i+1] & 0x03) << 4) | (pkt->data[i+2]>>4);
1324 unsigned seconds = ((pkt->data[i+2] & 0x07) << 3) | (pkt->data[i+3]>>5); 1324 unsigned seconds = ((pkt->data[i+2] & 0x07) << 3) | (pkt->data[i+3]>>5);
1325 unsigned frames = ((pkt->data[i+3] & 0x1f) << 1) | (pkt->data[i+4]>>7); 1325 unsigned frames = ((pkt->data[i+3] & 0x1f) << 1) | (pkt->data[i+4]>>7);
1326 mxf->timecode_drop_frame = !!(pkt->data[i+1] & 0x80); 1326 mxf->timecode_drop_frame = !!(pkt->data[i+1] & 0x80);
1327 mxf->timecode_start = (hours*3600 + minutes*60 + seconds) * 1327 mxf->timecode_start = (hours*3600 + minutes*60 + seconds) *
1328 mxf->timecode_base + frames; 1328 mxf->timecode_base + frames;
1329 if (mxf->timecode_drop_frame) { 1329 if (mxf->timecode_drop_frame) {
1330 unsigned tminutes = 60 * hours + minutes; 1330 unsigned tminutes = 60 * hours + minutes;
1331 mxf->timecode_start -= 2 * (tminutes - tminutes / 10); 1331 mxf->timecode_start -= 2 * (tminutes - tminutes / 10);
1332 }
1333 av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\n", mxf->timecode_start,
1334 hours, minutes, seconds, mxf->timecode_drop_frame ? ';':':', frames);
1335 } 1332 }
1333 av_log(s, AV_LOG_DEBUG, "frame %d %d:%d:%d%c%d\n", mxf->timecode_start,
1334 hours, minutes, seconds, mxf->timecode_drop_frame ? ';':':', frames);
1335 }
1336 } else if (c == 0x1b3) { // seq 1336 } else if (c == 0x1b3) { // seq
1337 *flags |= 0x40; 1337 *flags |= 0x40;
1338 switch ((pkt->data[i+4]>>4) & 0xf) { 1338 switch ((pkt->data[i+4]>>4) & 0xf) {
1339 case 2: sc->aspect_ratio = (AVRational){ 4, 3}; break; 1339 case 2: sc->aspect_ratio = (AVRational){ 4, 3}; break;
1340 case 3: sc->aspect_ratio = (AVRational){ 16, 9}; break; 1340 case 3: sc->aspect_ratio = (AVRational){ 16, 9}; break;
1341 case 4: sc->aspect_ratio = (AVRational){221,100}; break; 1341 case 4: sc->aspect_ratio = (AVRational){221,100}; break;
1342 default: 1342 default:
1343 av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den, 1343 av_reduce(&sc->aspect_ratio.num, &sc->aspect_ratio.den,
1344 st->codec->width, st->codec->height, 1024*1024); 1344 st->codec->width, st->codec->height, 1024*1024);
1345 } 1345 }
1346 } else if (c == 0x100) { // pic 1346 } else if (c == 0x100) { // pic
1347 int pict_type = (pkt->data[i+2]>>3) & 0x07; 1347 int pict_type = (pkt->data[i+2]>>3) & 0x07;
1348 if (pict_type == 2) { // P frame 1348 if (pict_type == 2) { // P frame
1349 *flags |= 0x22; 1349 *flags |= 0x22;
1350 st->codec->gop_size = 1; 1350 st->codec->gop_size = 1;