Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
dd4f8a04
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dd4f8a04
编写于
1月 20, 2005
作者:
M
Michael Niedermayer
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
jpeg style yuv fixes
Originally committed as revision 3852 to
svn://svn.ffmpeg.org/ffmpeg/trunk
上级
827c91bf
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
54 addition
and
22 deletion
+54
-22
libavcodec/mjpeg.c
libavcodec/mjpeg.c
+21
-4
libavcodec/mpegvideo.c
libavcodec/mpegvideo.c
+17
-2
tests/ffmpeg.regression.ref
tests/ffmpeg.regression.ref
+6
-6
tests/libav.regression.ref
tests/libav.regression.ref
+1
-1
tests/regression.sh
tests/regression.sh
+3
-3
tests/rotozoom.regression.ref
tests/rotozoom.regression.ref
+6
-6
未找到文件。
libavcodec/mjpeg.c
浏览文件 @
dd4f8a04
...
...
@@ -400,6 +400,19 @@ static void jpeg_put_comments(MpegEncContext *s)
ptr
[
0
]
=
size
>>
8
;
ptr
[
1
]
=
size
;
}
if
(
s
->
avctx
->
pix_fmt
==
PIX_FMT_YUV420P
||
s
->
avctx
->
pix_fmt
==
PIX_FMT_YUV422P
||
s
->
avctx
->
pix_fmt
==
PIX_FMT_YUV444P
){
put_marker
(
p
,
COM
);
flush_put_bits
(
p
);
ptr
=
pbBufPtr
(
p
);
put_bits
(
p
,
16
,
0
);
/* patched later */
put_string
(
p
,
"CS=ITU601"
,
1
);
size
=
strlen
(
"CS=ITU601"
)
+
3
;
ptr
[
0
]
=
size
>>
8
;
ptr
[
1
]
=
size
;
}
}
void
mjpeg_picture_header
(
MpegEncContext
*
s
)
...
...
@@ -845,6 +858,7 @@ typedef struct MJpegDecodeContext {
int
restart_count
;
int
buggy_avid
;
int
cs_itu601
;
int
interlace_polarity
;
int
mjpb_skiptosod
;
...
...
@@ -1133,16 +1147,16 @@ static int mjpeg_decode_sof(MJpegDecodeContext *s)
if
(
s
->
rgb
){
s
->
avctx
->
pix_fmt
=
PIX_FMT_RGBA32
;
}
else
if
(
s
->
nb_components
==
3
)
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV
444P
;
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
PIX_FMT_YUV444P
:
PIX_FMT_YUVJ
444P
;
else
s
->
avctx
->
pix_fmt
=
PIX_FMT_GRAY8
;
break
;
case
0x21
:
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV
422P
;
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
PIX_FMT_YUV422P
:
PIX_FMT_YUVJ
422P
;
break
;
default:
case
0x22
:
s
->
avctx
->
pix_fmt
=
PIX_FMT_YUV
420P
;
s
->
avctx
->
pix_fmt
=
s
->
cs_itu601
?
PIX_FMT_YUV420P
:
PIX_FMT_YUVJ
420P
;
break
;
}
...
...
@@ -1737,6 +1751,9 @@ static int mjpeg_decode_com(MJpegDecodeContext *s)
// if (s->first_picture)
// printf("mjpeg: workarounding buggy AVID\n");
}
else
if
(
!
strcmp
(
cbuf
,
"CS=ITU601"
)){
s
->
cs_itu601
=
1
;
}
av_free
(
cbuf
);
}
...
...
@@ -2172,7 +2189,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
s
->
v_max
=
2
;
s
->
qscale_table
=
av_mallocz
((
s
->
width
+
15
)
/
16
);
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
avctx
->
pix_fmt
=
s
->
cs_itu601
?
PIX_FMT_YUV420P
:
PIX_FMT_YUVJ420
;
s
->
interlaced
=
0
;
s
->
picture
.
reference
=
0
;
...
...
libavcodec/mpegvideo.c
浏览文件 @
dd4f8a04
...
...
@@ -892,7 +892,22 @@ int MPV_encode_init(AVCodecContext *avctx)
MPV_encode_defaults
(
s
);
avctx
->
pix_fmt
=
PIX_FMT_YUV420P
;
// FIXME
if
(
avctx
->
pix_fmt
!=
PIX_FMT_YUVJ420P
&&
avctx
->
pix_fmt
!=
PIX_FMT_YUV420P
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"only YUV420 is supported
\n
"
);
return
-
1
;
}
if
(
avctx
->
codec_id
==
CODEC_ID_MJPEG
||
avctx
->
codec_id
==
CODEC_ID_LJPEG
){
if
(
avctx
->
strict_std_compliance
>=
0
&&
avctx
->
pix_fmt
!=
PIX_FMT_YUVJ420P
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"colorspace not supported in jpeg
\n
"
);
return
-
1
;
}
}
else
{
if
(
avctx
->
strict_std_compliance
>=
0
&&
avctx
->
pix_fmt
!=
PIX_FMT_YUV420P
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"colorspace not supported
\n
"
);
return
-
1
;
}
}
s
->
bit_rate
=
avctx
->
bit_rate
;
s
->
width
=
avctx
->
width
;
...
...
@@ -2259,7 +2274,7 @@ int MPV_encode_picture(AVCodecContext *avctx,
AVFrame
*
pic_arg
=
data
;
int
i
,
stuffing_count
;
if
(
avctx
->
pix_fmt
!=
PIX_FMT_YUV420P
){
if
(
avctx
->
pix_fmt
!=
PIX_FMT_YUV420P
&&
avctx
->
pix_fmt
!=
PIX_FMT_YUVJ420P
){
av_log
(
avctx
,
AV_LOG_ERROR
,
"this codec supports only YUV420P
\n
"
);
return
-
1
;
}
...
...
tests/ffmpeg.regression.ref
浏览文件 @
dd4f8a04
...
...
@@ -87,12 +87,12 @@ stddev: 7.03 PSNR:31.18 bytes:7602176
1037657 ./data/a-mpeg1b.mpg
09a77de112e144c562bc1398b111b61b *./data/out.yuv
stddev: 6.35 PSNR:32.06 bytes:7602176
07042f42b3119c39eb26537a84a451df
*./data/a-mjpeg.avi
1
437768
./data/a-mjpeg.avi
f23a9e50a559e174766ee808c48fea22
*./data/out.yuv
stddev:
8.87 PSNR:29.15
bytes:7602176
1d565db4a3a054261af95f2483a37cd6
*./data/a-ljpeg.avi
626
27
62 ./data/a-ljpeg.avi
8e69394fdcb19995dfe5cb8c562d9441
*./data/a-mjpeg.avi
1
566544
./data/a-mjpeg.avi
18c3a76f984e717dd886d21fa04355f6
*./data/out.yuv
stddev:
7.93 PSNR:30.13
bytes:7602176
a534c6fc190682842efc0defda2cd442
*./data/a-ljpeg.avi
626
34
62 ./data/a-ljpeg.avi
799d3db687f6cdd7a837ec156efc171f *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
49c87af74432890cadb28b93da1c653d *./data/a-rv10.rm
...
...
tests/libav.regression.ref
浏览文件 @
dd4f8a04
...
...
@@ -43,7 +43,7 @@ b977a4fedff90a79baf70c8e02986820 *./data/b-libav.yuv4mpeg
3801810 ./data/b-libav.yuv4mpeg
./data/b-libav%d.pgm CRC=84c09106
./data/b-libav%d.ppm CRC=25c06ecf
./data/b-libav%d.jpg CRC=
afa6eff5
./data/b-libav%d.jpg CRC=
62328baa
b0a8c8063d81921db5d7c8f50a1cc454 *./data/b-libav.wav
89132 ./data/b-libav.wav
./data/b-libav.wav CRC=2a09519c
...
...
tests/regression.sh
浏览文件 @
dd4f8a04
...
...
@@ -360,7 +360,7 @@ fi
if
[
-n
"
$do_mjpeg
"
]
;
then
# mjpeg
file
=
${
outfile
}
mjpeg.avi
do_ffmpeg
$file
-y
-qscale
10
-f
pgmyuv
-i
$raw_src
-an
-vcodec
mjpeg
$file
do_ffmpeg
$file
-y
-qscale
10
-f
pgmyuv
-i
$raw_src
-an
-vcodec
mjpeg
-pix_fmt
yuvj420p
$file
# mjpeg decoding
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
$raw_dst
...
...
@@ -370,7 +370,7 @@ fi
if
[
-n
"
$do_ljpeg
"
]
;
then
# ljpeg
file
=
${
outfile
}
ljpeg.avi
do_ffmpeg
$file
-y
-f
pgmyuv
-i
$raw_src
-an
-vcodec
ljpeg
$file
do_ffmpeg
$file
-y
-f
pgmyuv
-i
$raw_src
-an
-vcodec
ljpeg
-strict
-1
$file
# ljpeg decoding
do_ffmpeg
$raw_dst
-y
-i
$file
-f
rawvideo
$raw_dst
...
...
@@ -601,7 +601,7 @@ do_ffmpeg_crc $file -i $file
# jpeg (we do not do md5 on image files yet)
file
=
${
outfile
}
libav%d.jpg
$ffmpeg
-t
0.5
-y
-qscale
10
-f
pgmyuv
-i
$raw_src
-bitexact
-dct_algo
1
-idct_algo
2
-f
image2
$file
$ffmpeg
-t
0.5
-y
-qscale
10
-f
pgmyuv
-i
$raw_src
-bitexact
-dct_algo
1
-idct_algo
2
-
pix_fmt
yuvj420p
-
f
image2
$file
do_ffmpeg_crc
$file
-f
image2
-i
$file
####################
...
...
tests/rotozoom.regression.ref
浏览文件 @
dd4f8a04
...
...
@@ -87,12 +87,12 @@ stddev: 4.73 PSNR:34.61 bytes:7602176
231306 ./data/a-mpeg1b.mpg
c665bd56f8e241f8bf3a5a8f803227c3 *./data/out.yuv
stddev: 4.13 PSNR:35.78 bytes:7602176
e9218a1db885fe0262e88f9df630307d
*./data/a-mjpeg.avi
63521
8 ./data/a-mjpeg.avi
a365b4da246ad68caf96b702b7f961a
1 *./data/out.yuv
stddev: 4.
76 PSNR:34.56
bytes:7602176
defd90b44bced2772c6ca0d8eb75f668
*./data/a-ljpeg.avi
476
48
22 ./data/a-ljpeg.avi
fab9b15954fe07a7d94ea4fa02af1ca2
*./data/a-mjpeg.avi
70252
8 ./data/a-mjpeg.avi
b1aa72cfb6f9cc3f525b27abc86a8f5
1 *./data/out.yuv
stddev: 4.
38 PSNR:35.28
bytes:7602176
29d6f3ca0833ed83cffa279d08e79419
*./data/a-ljpeg.avi
476
55
22 ./data/a-ljpeg.avi
dde5895817ad9d219f79a52d0bdfb001 *./data/out.yuv
stddev: 0.00 PSNR:99.99 bytes:7602176
2123b30d786e6e6e25caf337f24e7834 *./data/a-rv10.rm
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录