diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 20:54:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-08 21:06:57 +0200 |
commit | ac627b3d38d370027406c93c2dcaac0b1712a7d4 (patch) | |
tree | d2d1f39e96a75d864681349c4fbd37692e558683 /libavformat/yuv4mpeg.c | |
parent | 89715a3cf187c271f7cf4c230b23cd6f6d638e32 (diff) | |
parent | 716d413c13981da15323c7a3821860536eefdbbb (diff) | |
download | ffmpeg-ac627b3d38d370027406c93c2dcaac0b1712a7d4.tar.gz |
Merge commit '716d413c13981da15323c7a3821860536eefdbbb'
* commit '716d413c13981da15323c7a3821860536eefdbbb':
Replace PIX_FMT_* -> AV_PIX_FMT_*, PixelFormat -> AVPixelFormat
Conflicts:
doc/examples/muxing.c
ffmpeg.h
ffmpeg_filter.c
ffmpeg_opt.c
ffplay.c
ffprobe.c
libavcodec/8bps.c
libavcodec/aasc.c
libavcodec/aura.c
libavcodec/avcodec.h
libavcodec/avs.c
libavcodec/bfi.c
libavcodec/bmp.c
libavcodec/bmpenc.c
libavcodec/c93.c
libavcodec/cscd.c
libavcodec/cyuv.c
libavcodec/dpx.c
libavcodec/dpxenc.c
libavcodec/eatgv.c
libavcodec/escape124.c
libavcodec/ffv1.c
libavcodec/flashsv.c
libavcodec/fraps.c
libavcodec/h264.c
libavcodec/huffyuv.c
libavcodec/iff.c
libavcodec/imgconvert.c
libavcodec/indeo3.c
libavcodec/kmvc.c
libavcodec/libopenjpegdec.c
libavcodec/libopenjpegenc.c
libavcodec/libx264.c
libavcodec/ljpegenc.c
libavcodec/mjpegdec.c
libavcodec/mjpegenc.c
libavcodec/motionpixels.c
libavcodec/mpeg12.c
libavcodec/mpeg12enc.c
libavcodec/mpeg4videodec.c
libavcodec/mpegvideo_enc.c
libavcodec/pamenc.c
libavcodec/pcxenc.c
libavcodec/pgssubdec.c
libavcodec/pngdec.c
libavcodec/pngenc.c
libavcodec/pnm.c
libavcodec/pnmdec.c
libavcodec/pnmenc.c
libavcodec/ptx.c
libavcodec/qdrw.c
libavcodec/qpeg.c
libavcodec/qtrleenc.c
libavcodec/raw.c
libavcodec/rawdec.c
libavcodec/rl2.c
libavcodec/sgidec.c
libavcodec/sgienc.c
libavcodec/snowdec.c
libavcodec/snowenc.c
libavcodec/sunrast.c
libavcodec/targa.c
libavcodec/targaenc.c
libavcodec/tiff.c
libavcodec/tiffenc.c
libavcodec/tmv.c
libavcodec/truemotion2.c
libavcodec/utils.c
libavcodec/vb.c
libavcodec/vp3.c
libavcodec/wnv1.c
libavcodec/xl.c
libavcodec/xwddec.c
libavcodec/xwdenc.c
libavcodec/yop.c
libavdevice/v4l2.c
libavdevice/x11grab.c
libavfilter/avfilter.c
libavfilter/avfilter.h
libavfilter/buffersrc.c
libavfilter/drawutils.c
libavfilter/formats.c
libavfilter/src_movie.c
libavfilter/vf_ass.c
libavfilter/vf_drawtext.c
libavfilter/vf_fade.c
libavfilter/vf_format.c
libavfilter/vf_hflip.c
libavfilter/vf_lut.c
libavfilter/vf_overlay.c
libavfilter/vf_pad.c
libavfilter/vf_scale.c
libavfilter/vf_transpose.c
libavfilter/vf_yadif.c
libavfilter/video.c
libavfilter/vsrc_testsrc.c
libavformat/movenc.c
libavformat/mxf.h
libavformat/utils.c
libavformat/yuv4mpeg.c
libavutil/imgutils.c
libavutil/pixdesc.c
libswscale/input.c
libswscale/output.c
libswscale/swscale_internal.h
libswscale/swscale_unscaled.c
libswscale/utils.c
libswscale/x86/swscale_template.c
libswscale/x86/yuv2rgb.c
libswscale/x86/yuv2rgb_template.c
libswscale/yuv2rgb.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/yuv4mpeg.c')
-rw-r--r-- | libavformat/yuv4mpeg.c | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index b67209423c..cc13eafef1 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -58,53 +58,53 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf) inter = st->codec->coded_frame->top_field_first ? 't' : 'b'; switch (st->codec->pix_fmt) { - case PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY8: colorspace = " Cmono"; break; - case PIX_FMT_GRAY16: + case AV_PIX_FMT_GRAY16: colorspace = " Cmono16"; break; - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: colorspace = " C411 XYSCSS=411"; break; - case PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV420P: switch (st->codec->chroma_sample_location) { case AVCHROMA_LOC_TOPLEFT: colorspace = " C420paldv XYSCSS=420PALDV"; break; case AVCHROMA_LOC_LEFT: colorspace = " C420mpeg2 XYSCSS=420MPEG2"; break; default: colorspace = " C420jpeg XYSCSS=420JPEG"; break; } break; - case PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV422P: colorspace = " C422 XYSCSS=422"; break; - case PIX_FMT_YUV444P: + case AV_PIX_FMT_YUV444P: colorspace = " C444 XYSCSS=444"; break; - case PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV420P9: colorspace = " C420p9 XYSCSS=420P9"; break; - case PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV422P9: colorspace = " C422p9 XYSCSS=422P9"; break; - case PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV444P9: colorspace = " C444p9 XYSCSS=444P9"; break; - case PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV420P10: colorspace = " C420p10 XYSCSS=420P10"; break; - case PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV422P10: colorspace = " C422p10 XYSCSS=422P10"; break; - case PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV444P10: colorspace = " C444p10 XYSCSS=444P10"; break; - case PIX_FMT_YUV420P16: + case AV_PIX_FMT_YUV420P16: colorspace = " C420p16 XYSCSS=420P16"; break; - case PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV422P16: colorspace = " C422p16 XYSCSS=422P16"; break; - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV444P16: colorspace = " C444p16 XYSCSS=444P16"; break; } @@ -155,22 +155,22 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) ptr = picture->data[0]; switch (st->codec->pix_fmt) { - case PIX_FMT_GRAY8: - case PIX_FMT_YUV411P: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV444P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV444P: break; - case PIX_FMT_GRAY16: - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV422P9: - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV422P10: - case PIX_FMT_YUV444P10: - case PIX_FMT_YUV420P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_GRAY16: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV420P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV444P16: width *= 2; break; default: @@ -184,8 +184,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) ptr += picture->linesize[0]; } - if (st->codec->pix_fmt != PIX_FMT_GRAY8 && - st->codec->pix_fmt != PIX_FMT_GRAY16) { + if (st->codec->pix_fmt != AV_PIX_FMT_GRAY8 && + st->codec->pix_fmt != AV_PIX_FMT_GRAY16) { // Adjust for smaller Cb and Cr planes avcodec_get_chroma_sub_sample(st->codec->pix_fmt, &h_chroma_shift, &v_chroma_shift); @@ -222,25 +222,25 @@ static int yuv4_write_header(AVFormatContext *s) } switch (s->streams[0]->codec->pix_fmt) { - case PIX_FMT_YUV411P: + case AV_PIX_FMT_YUV411P: av_log(s, AV_LOG_WARNING, "Warning: generating rarely used 4:1:1 YUV " "stream, some mjpegtools might not work.\n"); break; - case PIX_FMT_GRAY8: - case PIX_FMT_GRAY16: - case PIX_FMT_YUV420P: - case PIX_FMT_YUV422P: - case PIX_FMT_YUV444P: + case AV_PIX_FMT_GRAY8: + case AV_PIX_FMT_GRAY16: + case AV_PIX_FMT_YUV420P: + case AV_PIX_FMT_YUV422P: + case AV_PIX_FMT_YUV444P: break; - case PIX_FMT_YUV420P9: - case PIX_FMT_YUV422P9: - case PIX_FMT_YUV444P9: - case PIX_FMT_YUV420P10: - case PIX_FMT_YUV422P10: - case PIX_FMT_YUV444P10: - case PIX_FMT_YUV420P16: - case PIX_FMT_YUV422P16: - case PIX_FMT_YUV444P16: + case AV_PIX_FMT_YUV420P9: + case AV_PIX_FMT_YUV422P9: + case AV_PIX_FMT_YUV444P9: + case AV_PIX_FMT_YUV420P10: + case AV_PIX_FMT_YUV422P10: + case AV_PIX_FMT_YUV444P10: + case AV_PIX_FMT_YUV420P16: + case AV_PIX_FMT_YUV422P16: + case AV_PIX_FMT_YUV444P16: if (s->streams[0]->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL) { av_log(s, AV_LOG_ERROR, "'%s' is not a official yuv4mpegpipe pixel format. " "Use '-strict -1' to encode to this pixel format.\n", @@ -291,7 +291,7 @@ static int yuv4_read_header(AVFormatContext *s) AVIOContext *pb = s->pb; int width = -1, height = -1, raten = 0, rated = 0, aspectn = 0, aspectd = 0; - enum PixelFormat pix_fmt = PIX_FMT_NONE, alt_pix_fmt = PIX_FMT_NONE; + enum AVPixelFormat pix_fmt = AV_PIX_FMT_NONE, alt_pix_fmt = AV_PIX_FMT_NONE; enum AVChromaLocation chroma_sample_location = AVCHROMA_LOC_UNSPECIFIED; AVStream *st; struct frame_attributes *s1 = s->priv_data; @@ -328,49 +328,49 @@ static int yuv4_read_header(AVFormatContext *s) break; case 'C': // Color space if (strncmp("420jpeg", tokstart, 7) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_CENTER; } else if (strncmp("420mpeg2", tokstart, 8) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_LEFT; } else if (strncmp("420paldv", tokstart, 8) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_TOPLEFT; } else if (strncmp("420p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV420P16; + pix_fmt = AV_PIX_FMT_YUV420P16; } else if (strncmp("422p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV422P16; + pix_fmt = AV_PIX_FMT_YUV422P16; } else if (strncmp("444p16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV444P16; + pix_fmt = AV_PIX_FMT_YUV444P16; } else if (strncmp("420p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV420P10; + pix_fmt = AV_PIX_FMT_YUV420P10; } else if (strncmp("422p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV422P10; + pix_fmt = AV_PIX_FMT_YUV422P10; } else if (strncmp("444p10", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_YUV444P10; + pix_fmt = AV_PIX_FMT_YUV444P10; } else if (strncmp("420p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV420P9; + pix_fmt = AV_PIX_FMT_YUV420P9; } else if (strncmp("422p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV422P9; + pix_fmt = AV_PIX_FMT_YUV422P9; } else if (strncmp("444p9", tokstart, 5) == 0) { - pix_fmt = PIX_FMT_YUV444P9; + pix_fmt = AV_PIX_FMT_YUV444P9; } else if (strncmp("420", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV420P; + pix_fmt = AV_PIX_FMT_YUV420P; chroma_sample_location = AVCHROMA_LOC_CENTER; } else if (strncmp("411", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV411P; + pix_fmt = AV_PIX_FMT_YUV411P; } else if (strncmp("422", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV422P; + pix_fmt = AV_PIX_FMT_YUV422P; } else if (strncmp("444alpha", tokstart, 8) == 0 ) { av_log(s, AV_LOG_ERROR, "Cannot handle 4:4:4:4 " "YUV4MPEG stream.\n"); return -1; } else if (strncmp("444", tokstart, 3) == 0) { - pix_fmt = PIX_FMT_YUV444P; + pix_fmt = AV_PIX_FMT_YUV444P; } else if (strncmp("mono16", tokstart, 6) == 0) { - pix_fmt = PIX_FMT_GRAY16; + pix_fmt = AV_PIX_FMT_GRAY16; } else if (strncmp("mono", tokstart, 4) == 0) { - pix_fmt = PIX_FMT_GRAY8; + pix_fmt = AV_PIX_FMT_GRAY8; } else { av_log(s, AV_LOG_ERROR, "YUV4MPEG stream contains an unknown " "pixel format.\n"); @@ -418,35 +418,35 @@ static int yuv4_read_header(AVFormatContext *s) // Older nonstandard pixel format representation tokstart += 6; if (strncmp("420JPEG", tokstart, 7) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420MPEG2", tokstart, 8) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420PALDV", tokstart, 8) == 0) - alt_pix_fmt = PIX_FMT_YUV420P; + alt_pix_fmt = AV_PIX_FMT_YUV420P; else if (strncmp("420P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV420P9; + alt_pix_fmt = AV_PIX_FMT_YUV420P9; else if (strncmp("422P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV422P9; + alt_pix_fmt = AV_PIX_FMT_YUV422P9; else if (strncmp("444P9", tokstart, 5) == 0) - alt_pix_fmt = PIX_FMT_YUV444P9; + alt_pix_fmt = AV_PIX_FMT_YUV444P9; else if (strncmp("420P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV420P10; + alt_pix_fmt = AV_PIX_FMT_YUV420P10; else if (strncmp("422P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV422P10; + alt_pix_fmt = AV_PIX_FMT_YUV422P10; else if (strncmp("444P10", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV444P10; + alt_pix_fmt = AV_PIX_FMT_YUV444P10; else if (strncmp("420P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV420P16; + alt_pix_fmt = AV_PIX_FMT_YUV420P16; else if (strncmp("422P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV422P16; + alt_pix_fmt = AV_PIX_FMT_YUV422P16; else if (strncmp("444P16", tokstart, 6) == 0) - alt_pix_fmt = PIX_FMT_YUV444P16; + alt_pix_fmt = AV_PIX_FMT_YUV444P16; else if (strncmp("411", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV411P; + alt_pix_fmt = AV_PIX_FMT_YUV411P; else if (strncmp("422", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV422P; + alt_pix_fmt = AV_PIX_FMT_YUV422P; else if (strncmp("444", tokstart, 3) == 0) - alt_pix_fmt = PIX_FMT_YUV444P; + alt_pix_fmt = AV_PIX_FMT_YUV444P; } while (tokstart < header_end && *tokstart != 0x20) tokstart++; @@ -459,9 +459,9 @@ static int yuv4_read_header(AVFormatContext *s) return -1; } - if (pix_fmt == PIX_FMT_NONE) { - if (alt_pix_fmt == PIX_FMT_NONE) - pix_fmt = PIX_FMT_YUV420P; + if (pix_fmt == AV_PIX_FMT_NONE) { + if (alt_pix_fmt == AV_PIX_FMT_NONE) + pix_fmt = AV_PIX_FMT_YUV420P; else pix_fmt = alt_pix_fmt; } |