[FFmpeg-devel] [PATCH 2/3] ffmpeg_filter: drop special handling of jpeg/ljpeg for pixel formats
Michael Niedermayer
michaelni at gmx.at
Wed Oct 2 14:33:27 CEST 2013
The code doesnt work anymore (as strict_std_compliance is not set at this point)
also its debatable in how far selecting non standard pixel formats with -strict -2
by default instead of forcing them explicitly with -pixfmt +YUV... is a good idea.
This patch is an alternative to the previous
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
ffmpeg_filter.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c
index 3007051..e1f52a6 100644
--- a/ffmpeg_filter.c
+++ b/ffmpeg_filter.c
@@ -42,14 +42,6 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
enum AVPixelFormat best= AV_PIX_FMT_NONE;
- if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
- if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
- } else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
- }
- }
for (; *p != AV_PIX_FMT_NONE; p++) {
best= avcodec_find_best_pix_fmt_of_2(best, *p, target, has_alpha, NULL);
if (*p == target)
@@ -117,15 +109,6 @@ static char *choose_pix_fmts(OutputStream *ost)
exit_program(1);
p = ost->enc->pix_fmts;
- if (ost->st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
- if (ost->st->codec->codec_id == AV_CODEC_ID_MJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
- } else if (ost->st->codec->codec_id == AV_CODEC_ID_LJPEG) {
- p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
- AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
- }
- }
-
for (; *p != AV_PIX_FMT_NONE; p++) {
const char *name = av_get_pix_fmt_name(*p);
avio_printf(s, "%s|", name);
--
1.7.9.5
More information about the ffmpeg-devel
mailing list