Compare commits
164 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
aba32d8463 | ||
![]() |
a3ff859a46 | ||
![]() |
3e63dea5f2 | ||
![]() |
2f76f54443 | ||
![]() |
faeb2b3e69 | ||
![]() |
fff5f65540 | ||
![]() |
7cb24ecd4c | ||
![]() |
9faf323d7e | ||
![]() |
78317ad8b9 | ||
![]() |
753c6377d3 | ||
![]() |
c3a5e7be84 | ||
![]() |
ad35215750 | ||
![]() |
8e2c8aaba4 | ||
![]() |
b5469fec6a | ||
![]() |
864a7e73b9 | ||
![]() |
562aa82d2a | ||
![]() |
3fb1a6c702 | ||
![]() |
dd64626022 | ||
![]() |
a31be9dd06 | ||
![]() |
c095137d1b | ||
![]() |
b63dbe2220 | ||
![]() |
5df2dc0f94 | ||
![]() |
4b03f2c522 | ||
![]() |
a8b92c4b3c | ||
![]() |
381e3e7e44 | ||
![]() |
ec18baadfa | ||
![]() |
2f98537ea0 | ||
![]() |
ebe645f02b | ||
![]() |
470ee0c660 | ||
![]() |
3cecef5b03 | ||
![]() |
155a0bed97 | ||
![]() |
ebb3a5974f | ||
![]() |
91e016865c | ||
![]() |
16b0b75327 | ||
![]() |
d338632e9f | ||
![]() |
bf19d4c6fa | ||
![]() |
5502b073ec | ||
![]() |
8bc0127b3d | ||
![]() |
5f0e5b4048 | ||
![]() |
e9ded2e1a9 | ||
![]() |
6d16f5c3f9 | ||
![]() |
28e609a84f | ||
![]() |
c6850d3862 | ||
![]() |
69cc119d64 | ||
![]() |
54ac3d10d1 | ||
![]() |
d3835cb877 | ||
![]() |
b06903e6c5 | ||
![]() |
a5069caecd | ||
![]() |
b5e72345a6 | ||
![]() |
99dbda3008 | ||
![]() |
d721cb009d | ||
![]() |
55b3e408fa | ||
![]() |
9f1e01c991 | ||
![]() |
450e4b1a60 | ||
![]() |
3581ab6ce0 | ||
![]() |
f1ec792ae3 | ||
![]() |
05e64b51bb | ||
![]() |
3593f577b0 | ||
![]() |
72791e41d4 | ||
![]() |
4155968fc6 | ||
![]() |
d14ce69869 | ||
![]() |
b45a8f6d24 | ||
![]() |
ae8491ce33 | ||
![]() |
3f78fe1d56 | ||
![]() |
fb52da522c | ||
![]() |
5231a35559 | ||
![]() |
606538df6c | ||
![]() |
a19010f7a6 | ||
![]() |
39fe8033bb | ||
![]() |
964f8419dd | ||
![]() |
5c2ffa2ce7 | ||
![]() |
6be8e44c00 | ||
![]() |
565581b0a4 | ||
![]() |
dc85ca0945 | ||
![]() |
a53ca16ae9 | ||
![]() |
92e5e62156 | ||
![]() |
e1c9434424 | ||
![]() |
af3f7c88f2 | ||
![]() |
b4294e2319 | ||
![]() |
7d97936495 | ||
![]() |
f9fc08de65 | ||
![]() |
31d3b3b5d5 | ||
![]() |
706809adb2 | ||
![]() |
4e66ca5f37 | ||
![]() |
530ce76a05 | ||
![]() |
0e74b21427 | ||
![]() |
381a914024 | ||
![]() |
d0d9182d3e | ||
![]() |
320704f739 | ||
![]() |
be1d65031f | ||
![]() |
bbc4d287c9 | ||
![]() |
3bb942e6f0 | ||
![]() |
e863d3306f | ||
![]() |
433ec3afa3 | ||
![]() |
d0cb4dc471 | ||
![]() |
95b1cbc4cb | ||
![]() |
177fc2438a | ||
![]() |
46b99bb70c | ||
![]() |
03275ed219 | ||
![]() |
ae5f69a98f | ||
![]() |
dc72a59fe5 | ||
![]() |
70af4f209f | ||
![]() |
0964e189da | ||
![]() |
7883efbbb2 | ||
![]() |
af67af5938 | ||
![]() |
d3c564b784 | ||
![]() |
bb5314daba | ||
![]() |
33a3f1fe9d | ||
![]() |
ac3fc94eb0 | ||
![]() |
d838c40823 | ||
![]() |
eea82203ba | ||
![]() |
617d91b76a | ||
![]() |
f1150e0c7d | ||
![]() |
f46b57657b | ||
![]() |
662ab44c2d | ||
![]() |
cc0a684497 | ||
![]() |
7f0f6602cb | ||
![]() |
d5d5f96068 | ||
![]() |
91ac6d9902 | ||
![]() |
0a311df6d9 | ||
![]() |
48094cb23a | ||
![]() |
d3d6849d17 | ||
![]() |
ddb92c6df1 | ||
![]() |
55a97399bc | ||
![]() |
eecbd9a78f | ||
![]() |
a441a96eb2 | ||
![]() |
dff4dbdf60 | ||
![]() |
622e926e9c | ||
![]() |
8ad71e276c | ||
![]() |
cdcd99eecc | ||
![]() |
9dc14fd3f0 | ||
![]() |
ba2d20b449 | ||
![]() |
b395bac383 | ||
![]() |
3768afd5a5 | ||
![]() |
e0f0486c7f | ||
![]() |
56e987d2cd | ||
![]() |
c64bfd7c3d | ||
![]() |
0e2b69b4e6 | ||
![]() |
63040dcddd | ||
![]() |
1e78d75d6a | ||
![]() |
91fdba3d79 | ||
![]() |
68efb539e3 | ||
![]() |
ee50ec19c7 | ||
![]() |
3a68e989ec | ||
![]() |
61a72fd9c8 | ||
![]() |
c254214ea3 | ||
![]() |
59417897be | ||
![]() |
03f82b5668 | ||
![]() |
7f8059bdfe | ||
![]() |
0f9098cb18 | ||
![]() |
c4e3dd06e8 | ||
![]() |
88a145738b | ||
![]() |
1ed0a61ea8 | ||
![]() |
9f2905d299 | ||
![]() |
f6c3fe94da | ||
![]() |
727749d30f | ||
![]() |
c7c82acf96 | ||
![]() |
f8f5db3b70 | ||
![]() |
51157dab37 | ||
![]() |
982caeac3e | ||
![]() |
d108d0804a | ||
![]() |
072e7fad87 | ||
![]() |
484302d183 | ||
![]() |
734cfa8e8b |
15
Changelog
15
Changelog
@@ -3,8 +3,19 @@ releases are sorted from youngest to oldest.
|
|||||||
|
|
||||||
version next:
|
version next:
|
||||||
|
|
||||||
|
version 0.11.2:
|
||||||
|
|
||||||
|
- Several bugs and crashes have been fixed as well as build problems
|
||||||
|
with recent mingw64
|
||||||
|
|
||||||
|
|
||||||
version 0.11:
|
version 0.11:
|
||||||
- Fixes CVE-2012-2771 ... 2805
|
Fixes:CVE-2012-2772, CVE-2012-2774, CVE-2012-2775, CVE-2012-2776, CVE-2012-2777,
|
||||||
|
CVE-2012-2779, CVE-2012-2782, CVE-2012-2783, CVE-2012-2784, CVE-2012-2785,
|
||||||
|
CVE-2012-2786, CVE-2012-2787, CVE-2012-2788, CVE-2012-2789, CVE-2012-2790,
|
||||||
|
CVE-2012-2791, CVE-2012-2792, CVE-2012-2793, CVE-2012-2794, CVE-2012-2795,
|
||||||
|
CVE-2012-2796, CVE-2012-2797, CVE-2012-2798, CVE-2012-2799, CVE-2012-2800,
|
||||||
|
CVE-2012-2801, CVE-2012-2802, CVE-2012-2803, CVE-2012-2804,
|
||||||
- v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder
|
- v408 Quicktime and Microsoft AYUV Uncompressed 4:4:4:4 encoder and decoder
|
||||||
- setfield filter
|
- setfield filter
|
||||||
- CDXL demuxer and decoder
|
- CDXL demuxer and decoder
|
||||||
@@ -33,7 +44,7 @@ version 0.11:
|
|||||||
- MicroDVD decoder
|
- MicroDVD decoder
|
||||||
- Avid Meridien (AVUI) encoder and decoder
|
- Avid Meridien (AVUI) encoder and decoder
|
||||||
- accept + prefix to -pix_fmt option to disable automatic conversions.
|
- accept + prefix to -pix_fmt option to disable automatic conversions.
|
||||||
- audio filters support in libavfilter and avconv
|
- complete audio filtering in libavfilter and ffmpeg
|
||||||
- add fps filter
|
- add fps filter
|
||||||
- audio split filter
|
- audio split filter
|
||||||
- vorbis parser
|
- vorbis parser
|
||||||
|
2
Doxyfile
2
Doxyfile
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER =
|
PROJECT_NUMBER = 0.11.3
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||||
# in the documentation. The maximum height of the logo should not exceed 55
|
# in the documentation. The maximum height of the logo should not exceed 55
|
||||||
|
@@ -400,9 +400,11 @@ x86 Michael Niedermayer
|
|||||||
Releases
|
Releases
|
||||||
========
|
========
|
||||||
|
|
||||||
0.11 Michael Niedermayer
|
1.2 Michael Niedermayer
|
||||||
0.10 Michael Niedermayer
|
1.1 Michael Niedermayer
|
||||||
|
1.0 Michael Niedermayer
|
||||||
|
|
||||||
|
If you want to maintain an older release, please contact us
|
||||||
|
|
||||||
|
|
||||||
GnuPG Fingerprints of maintainers and contributors
|
GnuPG Fingerprints of maintainers and contributors
|
||||||
|
@@ -59,7 +59,7 @@ struct SwsContext *sws_opts;
|
|||||||
SwrContext *swr_opts;
|
SwrContext *swr_opts;
|
||||||
AVDictionary *format_opts, *codec_opts;
|
AVDictionary *format_opts, *codec_opts;
|
||||||
|
|
||||||
const int this_year = 2012;
|
const int this_year = 2013;
|
||||||
|
|
||||||
static FILE *report_file;
|
static FILE *report_file;
|
||||||
|
|
||||||
|
30
configure
vendored
30
configure
vendored
@@ -112,7 +112,7 @@ Component options:
|
|||||||
--disable-swscale disable libswscale build
|
--disable-swscale disable libswscale build
|
||||||
--disable-postproc disable libpostproc build
|
--disable-postproc disable libpostproc build
|
||||||
--disable-avfilter disable video filter support [no]
|
--disable-avfilter disable video filter support [no]
|
||||||
--disable-avresample disable libavresample build [no]
|
--enable-avresample enable libavresample build [no]
|
||||||
--disable-pthreads disable pthreads [auto]
|
--disable-pthreads disable pthreads [auto]
|
||||||
--disable-w32threads disable Win32 threads [auto]
|
--disable-w32threads disable Win32 threads [auto]
|
||||||
--disable-os2threads disable OS/2 threads [auto]
|
--disable-os2threads disable OS/2 threads [auto]
|
||||||
@@ -1173,6 +1173,7 @@ HAVE_LIST="
|
|||||||
dlfcn_h
|
dlfcn_h
|
||||||
dlopen
|
dlopen
|
||||||
dos_paths
|
dos_paths
|
||||||
|
dxva_h
|
||||||
ebp_available
|
ebp_available
|
||||||
ebx_available
|
ebx_available
|
||||||
exp2
|
exp2
|
||||||
@@ -1217,7 +1218,6 @@ HAVE_LIST="
|
|||||||
memalign
|
memalign
|
||||||
mkstemp
|
mkstemp
|
||||||
mmap
|
mmap
|
||||||
netinet_sctp_h
|
|
||||||
PeekNamedPipe
|
PeekNamedPipe
|
||||||
poll_h
|
poll_h
|
||||||
posix_memalign
|
posix_memalign
|
||||||
@@ -1237,6 +1237,7 @@ HAVE_LIST="
|
|||||||
struct_addrinfo
|
struct_addrinfo
|
||||||
struct_ipv6_mreq
|
struct_ipv6_mreq
|
||||||
struct_rusage_ru_maxrss
|
struct_rusage_ru_maxrss
|
||||||
|
struct_sctp_event_subscribe
|
||||||
struct_sockaddr_in6
|
struct_sockaddr_in6
|
||||||
struct_sockaddr_sa_len
|
struct_sockaddr_sa_len
|
||||||
struct_sockaddr_storage
|
struct_sockaddr_storage
|
||||||
@@ -1665,7 +1666,7 @@ mmst_protocol_deps="network"
|
|||||||
rtmp_protocol_deps="!librtmp_protocol"
|
rtmp_protocol_deps="!librtmp_protocol"
|
||||||
rtmp_protocol_select="tcp_protocol"
|
rtmp_protocol_select="tcp_protocol"
|
||||||
rtp_protocol_select="udp_protocol"
|
rtp_protocol_select="udp_protocol"
|
||||||
sctp_protocol_deps="network netinet_sctp_h"
|
sctp_protocol_deps="network struct_sctp_event_subscribe"
|
||||||
tcp_protocol_deps="network"
|
tcp_protocol_deps="network"
|
||||||
tls_protocol_deps_any="openssl gnutls"
|
tls_protocol_deps_any="openssl gnutls"
|
||||||
tls_protocol_select="tcp_protocol"
|
tls_protocol_select="tcp_protocol"
|
||||||
@@ -1676,11 +1677,13 @@ aconvert_filter_deps="swresample"
|
|||||||
amovie_filter_deps="avcodec avformat"
|
amovie_filter_deps="avcodec avformat"
|
||||||
aresample_filter_deps="swresample"
|
aresample_filter_deps="swresample"
|
||||||
ass_filter_deps="libass"
|
ass_filter_deps="libass"
|
||||||
|
asyncts_filter_deps="avresample"
|
||||||
blackframe_filter_deps="gpl"
|
blackframe_filter_deps="gpl"
|
||||||
boxblur_filter_deps="gpl"
|
boxblur_filter_deps="gpl"
|
||||||
colormatrix_filter_deps="gpl"
|
colormatrix_filter_deps="gpl"
|
||||||
cropdetect_filter_deps="gpl"
|
cropdetect_filter_deps="gpl"
|
||||||
delogo_filter_deps="gpl"
|
delogo_filter_deps="gpl"
|
||||||
|
deshake_filter_deps="avcodec"
|
||||||
drawtext_filter_deps="libfreetype"
|
drawtext_filter_deps="libfreetype"
|
||||||
frei0r_filter_deps="frei0r dlopen"
|
frei0r_filter_deps="frei0r dlopen"
|
||||||
frei0r_filter_extralibs='$ldl'
|
frei0r_filter_extralibs='$ldl'
|
||||||
@@ -1878,7 +1881,6 @@ enable avcodec
|
|||||||
enable avdevice
|
enable avdevice
|
||||||
enable avfilter
|
enable avfilter
|
||||||
enable avformat
|
enable avformat
|
||||||
enable avresample
|
|
||||||
enable avutil
|
enable avutil
|
||||||
enable postproc
|
enable postproc
|
||||||
enable stripping
|
enable stripping
|
||||||
@@ -2852,6 +2854,10 @@ die_license_disabled() {
|
|||||||
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
|
enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
die_license_disabled_gpl() {
|
||||||
|
enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
|
||||||
|
}
|
||||||
|
|
||||||
die_license_disabled gpl libcdio
|
die_license_disabled gpl libcdio
|
||||||
die_license_disabled gpl libutvideo
|
die_license_disabled gpl libutvideo
|
||||||
die_license_disabled gpl libx264
|
die_license_disabled gpl libx264
|
||||||
@@ -2861,7 +2867,7 @@ die_license_disabled gpl x11grab
|
|||||||
|
|
||||||
die_license_disabled nonfree libaacplus
|
die_license_disabled nonfree libaacplus
|
||||||
die_license_disabled nonfree libfaac
|
die_license_disabled nonfree libfaac
|
||||||
die_license_disabled nonfree openssl
|
enabled gpl && die_license_disabled_gpl nonfree openssl
|
||||||
|
|
||||||
die_license_disabled version3 libopencore_amrnb
|
die_license_disabled version3 libopencore_amrnb
|
||||||
die_license_disabled version3 libopencore_amrwb
|
die_license_disabled version3 libopencore_amrwb
|
||||||
@@ -3065,7 +3071,7 @@ if enabled network; then
|
|||||||
check_type netinet/in.h "struct sockaddr_in6"
|
check_type netinet/in.h "struct sockaddr_in6"
|
||||||
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
|
check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
|
||||||
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
|
check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
|
||||||
check_header netinet/sctp.h
|
check_type netinet/sctp.h "struct sctp_event_subscribe"
|
||||||
# Prefer arpa/inet.h over winsock2
|
# Prefer arpa/inet.h over winsock2
|
||||||
if check_header arpa/inet.h ; then
|
if check_header arpa/inet.h ; then
|
||||||
check_func closesocket
|
check_func closesocket
|
||||||
@@ -3120,6 +3126,7 @@ check_func_headers windows.h VirtualAlloc
|
|||||||
check_func_headers glob.h glob
|
check_func_headers glob.h glob
|
||||||
|
|
||||||
check_header dlfcn.h
|
check_header dlfcn.h
|
||||||
|
check_header dxva.h
|
||||||
check_header dxva2api.h -D_WIN32_WINNT=0x0600
|
check_header dxva2api.h -D_WIN32_WINNT=0x0600
|
||||||
check_header libcrystalhd/libcrystalhd_if.h
|
check_header libcrystalhd/libcrystalhd_if.h
|
||||||
check_header malloc.h
|
check_header malloc.h
|
||||||
@@ -3284,7 +3291,14 @@ makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
|
|||||||
check_header linux/fb.h
|
check_header linux/fb.h
|
||||||
check_header linux/videodev.h
|
check_header linux/videodev.h
|
||||||
check_header linux/videodev2.h
|
check_header linux/videodev2.h
|
||||||
check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
|
check_cc <<EOF && enable_safe struct_v4l2_frmivalenum_discrete
|
||||||
|
#include <linux/videodev2.h>
|
||||||
|
int main(void) {
|
||||||
|
struct v4l2_frmsizeenum vfse;
|
||||||
|
vfse.discrete.width = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
check_header sys/videoio.h
|
check_header sys/videoio.h
|
||||||
|
|
||||||
@@ -3445,11 +3459,13 @@ elif enabled gcc; then
|
|||||||
check_cflags -fno-tree-vectorize
|
check_cflags -fno-tree-vectorize
|
||||||
check_cflags -Werror=implicit-function-declaration
|
check_cflags -Werror=implicit-function-declaration
|
||||||
check_cflags -Werror=missing-prototypes
|
check_cflags -Werror=missing-prototypes
|
||||||
|
check_cflags -Werror=return-type
|
||||||
elif enabled llvm_gcc; then
|
elif enabled llvm_gcc; then
|
||||||
check_cflags -mllvm -stack-alignment=16
|
check_cflags -mllvm -stack-alignment=16
|
||||||
elif enabled clang; then
|
elif enabled clang; then
|
||||||
check_cflags -mllvm -stack-alignment=16
|
check_cflags -mllvm -stack-alignment=16
|
||||||
check_cflags -Qunused-arguments
|
check_cflags -Qunused-arguments
|
||||||
|
check_cflags -Werror=return-type
|
||||||
elif enabled armcc; then
|
elif enabled armcc; then
|
||||||
# 2523: use of inline assembler is deprecated
|
# 2523: use of inline assembler is deprecated
|
||||||
add_cflags -W${armcc_opt},--diag_suppress=2523
|
add_cflags -W${armcc_opt},--diag_suppress=2523
|
||||||
|
276
doc/APIchanges
276
doc/APIchanges
@@ -31,39 +31,39 @@ API changes, most recent first:
|
|||||||
2012-03-26 - a67d9cf - lavfi 2.66.100
|
2012-03-26 - a67d9cf - lavfi 2.66.100
|
||||||
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
|
Add avfilter_fill_frame_from_{audio_,}buffer_ref() functions.
|
||||||
|
|
||||||
2012-05-15 - lavfi 2.17.0
|
2012-05-15 - lavfi 2.74.100 / 2.17.0
|
||||||
Add support for audio filters
|
Add support for audio filters
|
||||||
ac71230/a2cd9be - add video/audio buffer sink in a new installed
|
61930bd / ac71230, 1cbf7fb / a2cd9be - add video/audio buffer sink in a new installed
|
||||||
header buffersink.h
|
header buffersink.h
|
||||||
720c6b7 - add av_buffersrc_write_frame(), deprecate
|
1cbf7fb / 720c6b7 - add av_buffersrc_write_frame(), deprecate
|
||||||
av_vsrc_buffer_add_frame()
|
av_vsrc_buffer_add_frame()
|
||||||
ab16504 - add avfilter_copy_buf_props()
|
61930bd / ab16504 - add avfilter_copy_buf_props()
|
||||||
9453c9e - add extended_data to AVFilterBuffer
|
61930bd / 9453c9e - add extended_data to AVFilterBuffer
|
||||||
1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
|
61930bd / 1b8c927 - add avfilter_get_audio_buffer_ref_from_arrays()
|
||||||
|
|
||||||
2012-05-09 - lavu 51.30.0 - samplefmt.h
|
2012-05-09 - lavu 51.53.100 / 51.30.0 - samplefmt.h
|
||||||
142e740 - add av_samples_copy()
|
61930bd / 142e740 - add av_samples_copy()
|
||||||
6d7f617 - add av_samples_set_silence()
|
61930bd / 6d7f617 - add av_samples_set_silence()
|
||||||
|
|
||||||
2012-05-09 - a5117a2 - lavc 54.13.1
|
2012-05-09 - 61930bd / a5117a2 - lavc 54.21.101 / 54.13.1
|
||||||
For audio formats with fixed frame size, the last frame
|
For audio formats with fixed frame size, the last frame
|
||||||
no longer needs to be padded with silence, libavcodec
|
no longer needs to be padded with silence, libavcodec
|
||||||
will handle this internally (effectively all encoders
|
will handle this internally (effectively all encoders
|
||||||
behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
|
behave as if they had CODEC_CAP_SMALL_LAST_FRAME set).
|
||||||
|
|
||||||
2012-05-07 - 828bd08 - lavc 54.13.0 - avcodec.h
|
2012-05-07 - 653d117 / 828bd08 - lavc 54.20.100 / 54.13.0 - avcodec.h
|
||||||
Add sample_rate and channel_layout fields to AVFrame.
|
Add sample_rate and channel_layout fields to AVFrame.
|
||||||
|
|
||||||
2012-05-01 - 4010d72 - lavr 0.0.1
|
2012-05-01 - 2330eb1 / 4010d72 - lavr 0.0.1
|
||||||
Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
|
Change AV_MIX_COEFF_TYPE_Q6 to AV_MIX_COEFF_TYPE_Q8.
|
||||||
|
|
||||||
2012-04-25 - 3527a73 - lavu 51.29.0 - cpu.h
|
2012-04-25 - e890b68 / 3527a73 - lavu 51.48.100 / 51.29.0 - cpu.h
|
||||||
Add av_parse_cpu_flags()
|
Add av_parse_cpu_flags()
|
||||||
|
|
||||||
2012-04-24 - c8af852 - lavr 0.0.0
|
2012-04-24 - 3ead79e / c8af852 - lavr 0.0.0
|
||||||
Add libavresample audio conversion library
|
Add libavresample audio conversion library
|
||||||
|
|
||||||
2012-04-20 - 0c0d1bc - lavu 51.28.0 - audio_fifo.h
|
2012-04-20 - 3194ab7 / 0c0d1bc - lavu 51.47.100 / 51.28.0 - audio_fifo.h
|
||||||
Add audio FIFO functions:
|
Add audio FIFO functions:
|
||||||
av_audio_fifo_free()
|
av_audio_fifo_free()
|
||||||
av_audio_fifo_alloc()
|
av_audio_fifo_alloc()
|
||||||
@@ -75,10 +75,10 @@ API changes, most recent first:
|
|||||||
av_audio_fifo_size()
|
av_audio_fifo_size()
|
||||||
av_audio_fifo_space()
|
av_audio_fifo_space()
|
||||||
|
|
||||||
2012-04-14 - lavfi 2.16.0 - avfiltergraph.h
|
2012-04-14 - lavfi 2.70.100 / 2.16.0 - avfiltergraph.h
|
||||||
d7bcc71 Add avfilter_graph_parse2().
|
7432bcf / d7bcc71 Add avfilter_graph_parse2().
|
||||||
|
|
||||||
2012-04-08 - 4d693b0 - lavu 51.27.0 - samplefmt.h
|
2012-04-08 - 6bfb304 / 4d693b0 - lavu 51.46.100 / 51.27.0 - samplefmt.h
|
||||||
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
|
Add av_get_packed_sample_fmt() and av_get_planar_sample_fmt()
|
||||||
|
|
||||||
2012-03-21 - b75c67d - lavu 51.43.100
|
2012-03-21 - b75c67d - lavu 51.43.100
|
||||||
@@ -106,69 +106,69 @@ API changes, most recent first:
|
|||||||
2012-01-24 - 0c3577b - lavfi 2.60.100
|
2012-01-24 - 0c3577b - lavfi 2.60.100
|
||||||
Add avfilter_graph_dump.
|
Add avfilter_graph_dump.
|
||||||
|
|
||||||
2012-03-05 - lavc 54.8.0
|
2012-03-05 - lavc 54.10.100 / 54.8.0
|
||||||
6699d07 Add av_get_exact_bits_per_sample()
|
f095391 / 6699d07 Add av_get_exact_bits_per_sample()
|
||||||
9524cf7 Add av_get_audio_frame_duration()
|
f095391 / 9524cf7 Add av_get_audio_frame_duration()
|
||||||
|
|
||||||
2012-03-04 - 44fe77b - lavc 54.7.0 - avcodec.h
|
2012-03-04 - 2af8f2c / 44fe77b - lavc 54.8.100 / 54.7.0 - avcodec.h
|
||||||
Add av_codec_is_encoder/decoder().
|
Add av_codec_is_encoder/decoder().
|
||||||
|
|
||||||
2012-03-01 - 442c132 - lavc 54.3.0 - avcodec.h
|
2012-03-01 - 1eb7f39 / 442c132 - lavc 54.5.100 / 54.3.0 - avcodec.h
|
||||||
Add av_packet_shrink_side_data.
|
Add av_packet_shrink_side_data.
|
||||||
|
|
||||||
2012-02-29 - dd2a4bc - lavf 54.2.0 - avformat.h
|
2012-02-29 - 79ae084 / dd2a4bc - lavf 54.2.100 / 54.2.0 - avformat.h
|
||||||
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
|
Add AVStream.attached_pic and AV_DISPOSITION_ATTACHED_PIC,
|
||||||
used for dealing with attached pictures/cover art.
|
used for dealing with attached pictures/cover art.
|
||||||
|
|
||||||
2012-02-25 - c9bca80 - lavu 51.24.0 - error.h
|
2012-02-25 - 305e4b3 / c9bca80 - lavu 51.41.100 / 51.24.0 - error.h
|
||||||
Add AVERROR_UNKNOWN
|
Add AVERROR_UNKNOWN
|
||||||
NOTE: this was backported to 0.8
|
NOTE: this was backported to 0.8
|
||||||
|
|
||||||
2012-02-20 - e9cda85 - lavc 54.2.0
|
2012-02-20 - eadd426 / e9cda85 - lavc 54.2.100 / 54.2.0
|
||||||
Add duration field to AVCodecParserContext
|
Add duration field to AVCodecParserContext
|
||||||
|
|
||||||
2012-02-20 - 0b42a93 - lavu 51.23.1 - mathematics.h
|
2012-02-20 - eadd426 / 0b42a93 - lavu 51.40.100 / 51.23.1 - mathematics.h
|
||||||
Add av_rescale_q_rnd()
|
Add av_rescale_q_rnd()
|
||||||
|
|
||||||
2012-02-08 - 38d5533 - lavu 51.22.1 - pixdesc.h
|
2012-02-08 - f2b20b7 / 38d5533 - lavu 51.38.101 / 51.22.1 - pixdesc.h
|
||||||
Add PIX_FMT_PSEUDOPAL flag.
|
Add PIX_FMT_PSEUDOPAL flag.
|
||||||
|
|
||||||
2012-02-08 - 52f82a1 - lavc 54.01.0
|
2012-02-08 - f2b20b7 / 52f82a1 - lavc 54.2.100 / 54.1.0
|
||||||
Add avcodec_encode_video2() and deprecate avcodec_encode_video().
|
Add avcodec_encode_video2() and deprecate avcodec_encode_video().
|
||||||
|
|
||||||
2012-02-01 - 316fc74 - lavc 54.01.0
|
2012-02-01 - 4c677df / 316fc74 - lavc 54.1.0
|
||||||
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
|
Add av_fast_padded_malloc() as alternative for av_realloc() when aligned
|
||||||
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
|
memory is required. The buffer will always have FF_INPUT_BUFFER_PADDING_SIZE
|
||||||
zero-padded bytes at the end.
|
zero-padded bytes at the end.
|
||||||
|
|
||||||
2012-01-31 - dd6d3b0 - lavf 54.01.0
|
2012-01-31 - a369a6b / dd6d3b0 - lavf 54.1.0
|
||||||
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
|
Add avformat_get_riff_video_tags() and avformat_get_riff_audio_tags().
|
||||||
NOTE: this was backported to 0.8
|
NOTE: this was backported to 0.8
|
||||||
|
|
||||||
2012-01-31 - af08d9a - lavc 54.01.0
|
2012-01-31 - a369a6b / af08d9a - lavc 54.1.0
|
||||||
Add avcodec_is_open() function.
|
Add avcodec_is_open() function.
|
||||||
NOTE: this was backported to 0.8
|
NOTE: this was backported to 0.8
|
||||||
|
|
||||||
2012-01-30 - 8b93312 - lavu 51.22.0 - intfloat.h
|
2012-01-30 - 151ecc2 / 8b93312 - lavu 51.36.100 / 51.22.0 - intfloat.h
|
||||||
Add a new installed header libavutil/intfloat.h with int/float punning
|
Add a new installed header libavutil/intfloat.h with int/float punning
|
||||||
functions.
|
functions.
|
||||||
NOTE: this was backported to 0.8
|
NOTE: this was backported to 0.8
|
||||||
|
|
||||||
2012-01-25 - lavf 53.22.0
|
2012-01-25 - lavf 53.31.100 / 53.22.0
|
||||||
f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
|
3c5fe5b / f1caf01 Allow doing av_write_frame(ctx, NULL) for flushing possible
|
||||||
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
|
buffered data within a muxer. Added AVFMT_ALLOW_FLUSH for
|
||||||
muxers supporting it (av_write_frame makes sure it is called
|
muxers supporting it (av_write_frame makes sure it is called
|
||||||
only for muxers with this flag).
|
only for muxers with this flag).
|
||||||
|
|
||||||
2012-01-15 - lavc 53.34.0
|
2012-01-15 - lavc 53.56.105 / 53.34.0
|
||||||
New audio encoding API:
|
New audio encoding API:
|
||||||
b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
|
67f5650 / b2c75b6 Add CODEC_CAP_VARIABLE_FRAME_SIZE capability for use by audio
|
||||||
encoders.
|
encoders.
|
||||||
5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
|
67f5650 / 5ee5fa0 Add avcodec_fill_audio_frame() as a convenience function.
|
||||||
b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
|
67f5650 / b2c75b6 Add avcodec_encode_audio2() and deprecate avcodec_encode_audio().
|
||||||
Add AVCodec.encode2().
|
Add AVCodec.encode2().
|
||||||
|
|
||||||
2012-01-12 - 3167dc9 - lavfi 2.15.0
|
2012-01-12 - b18e17e / 3167dc9 - lavfi 2.59.100 / 2.15.0
|
||||||
Add a new installed header -- libavfilter/version.h -- with version macros.
|
Add a new installed header -- libavfilter/version.h -- with version macros.
|
||||||
|
|
||||||
2011-12-08 - a502939 - lavfi 2.52.0
|
2011-12-08 - a502939 - lavfi 2.52.0
|
||||||
@@ -189,37 +189,37 @@ API changes, most recent first:
|
|||||||
2011-10-20 - b35e9e1 - lavu 51.22.0
|
2011-10-20 - b35e9e1 - lavu 51.22.0
|
||||||
Add av_strtok() to avstring.h.
|
Add av_strtok() to avstring.h.
|
||||||
|
|
||||||
2011-01-03 - b73ec05 - lavu 51.21.0
|
2012-01-03 - ad1c8dd / b73ec05 - lavu 51.34.100 / 51.21.0
|
||||||
Add av_popcount64
|
Add av_popcount64
|
||||||
|
|
||||||
2011-12-18 - 8400b12 - lavc 53.28.1
|
2011-12-18 - 7c29313 / 8400b12 - lavc 53.46.1 / 53.28.1
|
||||||
Deprecate AVFrame.age. The field is unused.
|
Deprecate AVFrame.age. The field is unused.
|
||||||
|
|
||||||
2011-12-12 - 5266045 - lavf 53.17.0
|
2011-12-12 - 8bc7fe4 / 5266045 - lavf 53.25.0 / 53.17.0
|
||||||
Add avformat_close_input().
|
Add avformat_close_input().
|
||||||
Deprecate av_close_input_file() and av_close_input_stream().
|
Deprecate av_close_input_file() and av_close_input_stream().
|
||||||
|
|
||||||
2011-12-02 - 0eea212 - lavc 53.25.0
|
2011-12-02 - e4de716 / 0eea212 - lavc 53.40.0 / 53.25.0
|
||||||
Add nb_samples and extended_data fields to AVFrame.
|
Add nb_samples and extended_data fields to AVFrame.
|
||||||
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
|
Deprecate AVCODEC_MAX_AUDIO_FRAME_SIZE.
|
||||||
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
|
Deprecate avcodec_decode_audio3() in favor of avcodec_decode_audio4().
|
||||||
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
|
avcodec_decode_audio4() writes output samples to an AVFrame, which allows
|
||||||
audio decoders to use get_buffer().
|
audio decoders to use get_buffer().
|
||||||
|
|
||||||
2011-12-04 - 560f773 - lavc 53.24.0
|
2011-12-04 - e4de716 / 560f773 - lavc 53.40.0 / 53.24.0
|
||||||
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
|
Change AVFrame.data[4]/base[4]/linesize[4]/error[4] to [8] at next major bump.
|
||||||
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
|
Change AVPicture.data[4]/linesize[4] to [8] at next major bump.
|
||||||
Change AVCodecContext.error[4] to [8] at next major bump.
|
Change AVCodecContext.error[4] to [8] at next major bump.
|
||||||
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
|
Add AV_NUM_DATA_POINTERS to simplify the bump transition.
|
||||||
|
|
||||||
2011-11-23 - bbb46f3 - lavu 51.18.0
|
2011-11-23 - 8e576d5 / bbb46f3 - lavu 51.27.0 / 51.18.0
|
||||||
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
|
Add av_samples_get_buffer_size(), av_samples_fill_arrays(), and
|
||||||
av_samples_alloc(), to samplefmt.h.
|
av_samples_alloc(), to samplefmt.h.
|
||||||
|
|
||||||
2011-11-23 - 8889cc4 - lavu 51.17.0
|
2011-11-23 - 8e576d5 / 8889cc4 - lavu 51.27.0 / 51.17.0
|
||||||
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
|
Add planar sample formats and av_sample_fmt_is_planar() to samplefmt.h.
|
||||||
|
|
||||||
2011-11-19 - f3a29b7 - lavc 53.21.0
|
2011-11-19 - dbb38bc / f3a29b7 - lavc 53.36.0 / 53.21.0
|
||||||
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
|
Move some AVCodecContext fields to a new private struct, AVCodecInternal,
|
||||||
which is accessed from a new field, AVCodecContext.internal.
|
which is accessed from a new field, AVCodecContext.internal.
|
||||||
- fields moved:
|
- fields moved:
|
||||||
@@ -227,55 +227,55 @@ API changes, most recent first:
|
|||||||
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
|
AVCodecContext.internal_buffer_count --> AVCodecInternal.buffer_count
|
||||||
AVCodecContext.is_copy --> AVCodecInternal.is_copy
|
AVCodecContext.is_copy --> AVCodecInternal.is_copy
|
||||||
|
|
||||||
2011-11-16 - 6270671 - lavu 51.16.0
|
2011-11-16 - 8709ba9 / 6270671 - lavu 51.26.0 / 51.16.0
|
||||||
Add av_timegm()
|
Add av_timegm()
|
||||||
|
|
||||||
2011-11-13 - lavf 53.15.0
|
2011-11-13 - lavf 53.21.0 / 53.15.0
|
||||||
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
|
New interrupt callback API, allowing per-AVFormatContext/AVIOContext
|
||||||
interrupt callbacks.
|
interrupt callbacks.
|
||||||
6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
|
5f268ca / 6aa0b98 Add AVIOInterruptCB struct and the interrupt_callback field to
|
||||||
AVFormatContext.
|
AVFormatContext.
|
||||||
1dee0ac Add avio_open2() with additional parameters. Those are
|
5f268ca / 1dee0ac Add avio_open2() with additional parameters. Those are
|
||||||
an interrupt callback and an options AVDictionary.
|
an interrupt callback and an options AVDictionary.
|
||||||
This will allow passing AVOptions to protocols after lavf
|
This will allow passing AVOptions to protocols after lavf
|
||||||
54.0.
|
54.0.
|
||||||
|
|
||||||
2011-11-06 - ba04ecf - lavu 51.14.0
|
2011-11-06 - 13b7781 / ba04ecf - lavu 51.24.0 / 51.14.0
|
||||||
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
|
Add av_strcasecmp() and av_strncasecmp() to avstring.h.
|
||||||
|
|
||||||
2011-11-06 - 07b172f - lavu 51.13.0
|
2011-11-06 - 13b7781 / 07b172f - lavu 51.24.0 / 51.13.0
|
||||||
Add av_toupper()/av_tolower()
|
Add av_toupper()/av_tolower()
|
||||||
|
|
||||||
2011-11-05 - b6d08f4 - lavf 53.13.0
|
2011-11-05 - d8cab5c / b6d08f4 - lavf 53.19.0 / 53.13.0
|
||||||
Add avformat_network_init()/avformat_network_deinit()
|
Add avformat_network_init()/avformat_network_deinit()
|
||||||
|
|
||||||
2011-10-27 - 512557b - lavc 53.15.0
|
2011-10-27 - 6faf0a2 / 512557b - lavc 53.24.0 / 53.15.0
|
||||||
Remove avcodec_parse_frame.
|
Remove avcodec_parse_frame.
|
||||||
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
|
Deprecate AVCodecContext.parse_only and CODEC_CAP_PARSE_ONLY.
|
||||||
|
|
||||||
2011-10-19 - 569129a - lavf 53.10.0
|
2011-10-19 - d049257 / 569129a - lavf 53.17.0 / 53.10.0
|
||||||
Add avformat_new_stream(). Deprecate av_new_stream().
|
Add avformat_new_stream(). Deprecate av_new_stream().
|
||||||
|
|
||||||
2011-10-13 - b631fba - lavf 53.9.0
|
2011-10-13 - 91eb1b1 / b631fba - lavf 53.16.0 / 53.9.0
|
||||||
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
|
Add AVFMT_NO_BYTE_SEEK AVInputFormat flag.
|
||||||
|
|
||||||
2011-10-12 - lavu 51.12.0
|
2011-10-12 - lavu 51.21.0 / 51.12.0
|
||||||
AVOptions API rewrite.
|
AVOptions API rewrite.
|
||||||
|
|
||||||
- 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
|
- f884ef0 / 145f741 FF_OPT_TYPE* renamed to AV_OPT_TYPE_*
|
||||||
- new setting/getting functions with slightly different semantics:
|
- new setting/getting functions with slightly different semantics:
|
||||||
dac66da av_set_string3 -> av_opt_set
|
f884ef0 / dac66da av_set_string3 -> av_opt_set
|
||||||
av_set_double -> av_opt_set_double
|
av_set_double -> av_opt_set_double
|
||||||
av_set_q -> av_opt_set_q
|
av_set_q -> av_opt_set_q
|
||||||
av_set_int -> av_opt_set_int
|
av_set_int -> av_opt_set_int
|
||||||
|
|
||||||
41d9d51 av_get_string -> av_opt_get
|
f884ef0 / 41d9d51 av_get_string -> av_opt_get
|
||||||
av_get_double -> av_opt_get_double
|
av_get_double -> av_opt_get_double
|
||||||
av_get_q -> av_opt_get_q
|
av_get_q -> av_opt_get_q
|
||||||
av_get_int -> av_opt_get_int
|
av_get_int -> av_opt_get_int
|
||||||
|
|
||||||
- 8c5dcaa trivial rename av_next_option -> av_opt_next
|
- f884ef0 / 8c5dcaa trivial rename av_next_option -> av_opt_next
|
||||||
- 641c7af new functions - av_opt_child_next, av_opt_child_class_next
|
- f884ef0 / 641c7af new functions - av_opt_child_next, av_opt_child_class_next
|
||||||
and av_opt_find2()
|
and av_opt_find2()
|
||||||
|
|
||||||
2011-09-22 - a70e787 - lavu 51.17.0
|
2011-09-22 - a70e787 - lavu 51.17.0
|
||||||
@@ -321,31 +321,31 @@ API changes, most recent first:
|
|||||||
2011-08-20 - 69e2c1a - lavu 51.13.0
|
2011-08-20 - 69e2c1a - lavu 51.13.0
|
||||||
Add av_get_media_type_string().
|
Add av_get_media_type_string().
|
||||||
|
|
||||||
2011-09-03 - fb4ca26 - lavc 53.13.0
|
2011-09-03 - 1889c67 / fb4ca26 - lavc 53.13.0
|
||||||
lavf 53.11.0
|
lavf 53.11.0
|
||||||
lsws 2.1.0
|
lsws 2.1.0
|
||||||
Add {avcodec,avformat,sws}_get_class().
|
Add {avcodec,avformat,sws}_get_class().
|
||||||
|
|
||||||
2011-08-03 - c11fb82 - lavu 51.15.0
|
2011-08-03 - 1889c67 / c11fb82 - lavu 51.15.0
|
||||||
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
|
Add AV_OPT_SEARCH_FAKE_OBJ flag for av_opt_find() function.
|
||||||
|
|
||||||
2011-08-14 - 323b930 - lavu 51.12.0
|
2011-08-14 - 323b930 - lavu 51.12.0
|
||||||
Add av_fifo_peek2(), deprecate av_fifo_peek().
|
Add av_fifo_peek2(), deprecate av_fifo_peek().
|
||||||
|
|
||||||
2011-08-26 - lavu 51.9.0
|
2011-08-26 - lavu 51.14.0 / 51.9.0
|
||||||
- add41de..abc78a5 Do not include intfloat_readwrite.h,
|
- 976a8b2 / add41de..976a8b2 / abc78a5 Do not include intfloat_readwrite.h,
|
||||||
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
|
mathematics.h, rational.h, pixfmt.h, or log.h from avutil.h.
|
||||||
|
|
||||||
2011-08-16 - 48f9e45 - lavf 53.8.0
|
2011-08-16 - 27fbe31 / 48f9e45 - lavf 53.11.0 / 53.8.0
|
||||||
Add avformat_query_codec().
|
Add avformat_query_codec().
|
||||||
|
|
||||||
2011-08-16 - bca06e7 - lavc 53.11.0
|
2011-08-16 - 27fbe31 / bca06e7 - lavc 53.11.0
|
||||||
Add avcodec_get_type().
|
Add avcodec_get_type().
|
||||||
|
|
||||||
2011-08-06 - 2f63440 - lavf 53.7.0
|
2011-08-06 - 0cb233c / 2f63440 - lavf 53.7.0
|
||||||
Add error_recognition to AVFormatContext.
|
Add error_recognition to AVFormatContext.
|
||||||
|
|
||||||
2011-08-02 - 9d39cbf - lavc 53.9.1
|
2011-08-02 - 1d186e9 / 9d39cbf - lavc 53.9.1
|
||||||
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
|
Add AV_PKT_FLAG_CORRUPT AVPacket flag.
|
||||||
|
|
||||||
2011-07-16 - b57df29 - lavfi 2.27.0
|
2011-07-16 - b57df29 - lavfi 2.27.0
|
||||||
@@ -356,11 +356,11 @@ API changes, most recent first:
|
|||||||
avfilter_set_common_packing_formats()
|
avfilter_set_common_packing_formats()
|
||||||
avfilter_all_packing_formats()
|
avfilter_all_packing_formats()
|
||||||
|
|
||||||
2011-07-10 - a67c061 - lavf 53.6.0
|
2011-07-10 - 3602ad7 / a67c061 - lavf 53.6.0
|
||||||
Add avformat_find_stream_info(), deprecate av_find_stream_info().
|
Add avformat_find_stream_info(), deprecate av_find_stream_info().
|
||||||
NOTE: this was backported to 0.7
|
NOTE: this was backported to 0.7
|
||||||
|
|
||||||
2011-07-10 - 0b950fe - lavc 53.8.0
|
2011-07-10 - 3602ad7 / 0b950fe - lavc 53.8.0
|
||||||
Add avcodec_open2(), deprecate avcodec_open().
|
Add avcodec_open2(), deprecate avcodec_open().
|
||||||
NOTE: this was backported to 0.7
|
NOTE: this was backported to 0.7
|
||||||
|
|
||||||
@@ -403,35 +403,35 @@ API changes, most recent first:
|
|||||||
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
|
2011-06-12 - 6119b23 - lavfi 2.16.0 - avfilter_graph_parse()
|
||||||
Change avfilter_graph_parse() signature.
|
Change avfilter_graph_parse() signature.
|
||||||
|
|
||||||
2011-06-23 - 67e9ae1 - lavu 51.8.0 - attributes.h
|
2011-06-23 - 686959e / 67e9ae1 - lavu 51.10.0 / 51.8.0 - attributes.h
|
||||||
Add av_printf_format().
|
Add av_printf_format().
|
||||||
|
|
||||||
2011-06-16 - 05e84c9, 25de595 - lavf 53.2.0 - avformat.h
|
2011-06-16 - 2905e3f / 05e84c9, 2905e3f / 25de595 - lavf 53.4.0 / 53.2.0 - avformat.h
|
||||||
Add avformat_open_input and avformat_write_header().
|
Add avformat_open_input and avformat_write_header().
|
||||||
Deprecate av_open_input_stream, av_open_input_file,
|
Deprecate av_open_input_stream, av_open_input_file,
|
||||||
AVFormatParameters and av_write_header.
|
AVFormatParameters and av_write_header.
|
||||||
|
|
||||||
2011-06-16 - 7e83e1c, dc59ec5 - lavu 51.7.0 - opt.h
|
2011-06-16 - 2905e3f / 7e83e1c, 2905e3f / dc59ec5 - lavu 51.9.0 / 51.7.0 - opt.h
|
||||||
Add av_opt_set_dict() and av_opt_find().
|
Add av_opt_set_dict() and av_opt_find().
|
||||||
Deprecate av_find_opt().
|
Deprecate av_find_opt().
|
||||||
Add AV_DICT_APPEND flag.
|
Add AV_DICT_APPEND flag.
|
||||||
|
|
||||||
2011-06-10 - cb7c11c - lavu 51.6.0 - opt.h
|
2011-06-10 - 45fb647 / cb7c11c - lavu 51.6.0 - opt.h
|
||||||
Add av_opt_flag_is_set().
|
Add av_opt_flag_is_set().
|
||||||
|
|
||||||
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
2011-06-10 - c381960 - lavfi 2.15.0 - avfilter_get_audio_buffer_ref_from_arrays
|
||||||
Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
|
Add avfilter_get_audio_buffer_ref_from_arrays() to avfilter.h.
|
||||||
|
|
||||||
2011-06-09 - d9f80ea - lavu 51.8.0 - AVMetadata
|
2011-06-09 - f9ecb84 / d9f80ea - lavu 51.8.0 - AVMetadata
|
||||||
Move AVMetadata from lavf to lavu and rename it to
|
Move AVMetadata from lavf to lavu and rename it to
|
||||||
AVDictionary -- new installed header dict.h.
|
AVDictionary -- new installed header dict.h.
|
||||||
All av_metadata_* functions renamed to av_dict_*.
|
All av_metadata_* functions renamed to av_dict_*.
|
||||||
|
|
||||||
2011-06-07 - a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
|
2011-06-07 - d552f61 / a6703fa - lavu 51.8.0 - av_get_bytes_per_sample()
|
||||||
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
|
Add av_get_bytes_per_sample() in libavutil/samplefmt.h.
|
||||||
Deprecate av_get_bits_per_sample_fmt().
|
Deprecate av_get_bits_per_sample_fmt().
|
||||||
|
|
||||||
2011-06-05 - b39b062 - lavu 51.8.0 - opt.h
|
2011-06-05 - f956924 / b39b062 - lavu 51.8.0 - opt.h
|
||||||
Add av_opt_free convenience function.
|
Add av_opt_free convenience function.
|
||||||
|
|
||||||
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
|
2011-06-06 - 95a0242 - lavfi 2.14.0 - AVFilterBufferRefAudioProps
|
||||||
@@ -461,7 +461,7 @@ API changes, most recent first:
|
|||||||
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
|
Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
|
||||||
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
|
avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
|
||||||
|
|
||||||
2011-05-25 - 30315a8 - lavf 53.3.0 - avformat.h
|
2011-05-25 - 39e4206 / 30315a8 - lavf 53.3.0 - avformat.h
|
||||||
Add fps_probe_size to AVFormatContext.
|
Add fps_probe_size to AVFormatContext.
|
||||||
|
|
||||||
2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
|
2011-05-22 - 5ecdfd0 - lavf 53.2.0 - avformat.h
|
||||||
@@ -477,10 +477,10 @@ API changes, most recent first:
|
|||||||
2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h
|
2011-05-14 - 9fdf772 - lavfi 2.6.0 - avcodec.h
|
||||||
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
|
Add avfilter_get_video_buffer_ref_from_frame() to libavfilter/avcodec.h.
|
||||||
|
|
||||||
2011-05-18 - 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
|
2011-05-18 - 75a37b5 / 64150ff - lavc 53.7.0 - AVCodecContext.request_sample_fmt
|
||||||
Add request_sample_fmt field to AVCodecContext.
|
Add request_sample_fmt field to AVCodecContext.
|
||||||
|
|
||||||
2011-05-10 - 188dea1 - lavc 53.6.0 - avcodec.h
|
2011-05-10 - 59eb12f / 188dea1 - lavc 53.6.0 - avcodec.h
|
||||||
Deprecate AVLPCType and the following fields in
|
Deprecate AVLPCType and the following fields in
|
||||||
AVCodecContext: lpc_coeff_precision, prediction_order_method,
|
AVCodecContext: lpc_coeff_precision, prediction_order_method,
|
||||||
min_partition_order, max_partition_order, lpc_type, lpc_passes.
|
min_partition_order, max_partition_order, lpc_type, lpc_passes.
|
||||||
@@ -510,81 +510,81 @@ API changes, most recent first:
|
|||||||
Add av_dynarray_add function for adding
|
Add av_dynarray_add function for adding
|
||||||
an element to a dynamic array.
|
an element to a dynamic array.
|
||||||
|
|
||||||
2011-04-26 - bebe72f - lavu 51.1.0 - avutil.h
|
2011-04-26 - d7e5aeb / bebe72f - lavu 51.1.0 - avutil.h
|
||||||
Add AVPictureType enum and av_get_picture_type_char(), deprecate
|
Add AVPictureType enum and av_get_picture_type_char(), deprecate
|
||||||
FF_*_TYPE defines and av_get_pict_type_char() defined in
|
FF_*_TYPE defines and av_get_pict_type_char() defined in
|
||||||
libavcodec/avcodec.h.
|
libavcodec/avcodec.h.
|
||||||
|
|
||||||
2011-04-26 - 10d3940 - lavfi 2.3.0 - avfilter.h
|
2011-04-26 - d7e5aeb / 10d3940 - lavfi 2.3.0 - avfilter.h
|
||||||
Add pict_type and key_frame fields to AVFilterBufferRefVideo.
|
Add pict_type and key_frame fields to AVFilterBufferRefVideo.
|
||||||
|
|
||||||
2011-04-26 - 7a11c82 - lavfi 2.2.0 - vsrc_buffer
|
2011-04-26 - d7e5aeb / 7a11c82 - lavfi 2.2.0 - vsrc_buffer
|
||||||
Add sample_aspect_ratio fields to vsrc_buffer arguments
|
Add sample_aspect_ratio fields to vsrc_buffer arguments
|
||||||
|
|
||||||
2011-04-21 - 94f7451 - lavc 53.1.0 - avcodec.h
|
2011-04-21 - 8772156 / 94f7451 - lavc 53.1.0 - avcodec.h
|
||||||
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
|
Add CODEC_CAP_SLICE_THREADS for codecs supporting sliced threading.
|
||||||
|
|
||||||
2011-04-15 - lavc 52.120.0 - avcodec.h
|
2011-04-15 - lavc 52.120.0 - avcodec.h
|
||||||
AVPacket structure got additional members for passing side information:
|
AVPacket structure got additional members for passing side information:
|
||||||
4de339e introduce side information for AVPacket
|
c407984 / 4de339e introduce side information for AVPacket
|
||||||
2d8591c make containers pass palette change in AVPacket
|
c407984 / 2d8591c make containers pass palette change in AVPacket
|
||||||
|
|
||||||
2011-04-12 - lavf 52.107.0 - avio.h
|
2011-04-12 - lavf 52.107.0 - avio.h
|
||||||
Avio cleanup, part II - deprecate the entire URLContext API:
|
Avio cleanup, part II - deprecate the entire URLContext API:
|
||||||
175389c add avio_check as a replacement for url_exist
|
c55780d / 175389c add avio_check as a replacement for url_exist
|
||||||
ff1ec0c add avio_pause and avio_seek_time as replacements
|
9891004 / ff1ec0c add avio_pause and avio_seek_time as replacements
|
||||||
for _av_url_read_fseek/fpause
|
for _av_url_read_fseek/fpause
|
||||||
cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
|
d4d0932 / cdc6a87 deprecate av_protocol_next(), avio_enum_protocols
|
||||||
should be used instead.
|
should be used instead.
|
||||||
80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
|
c88caa5 / 80c6e23 rename url_set_interrupt_cb->avio_set_interrupt_cb.
|
||||||
f87b1b3 rename open flags: URL_* -> AVIO_*
|
c88caa5 / f87b1b3 rename open flags: URL_* -> AVIO_*
|
||||||
f8270bb add avio_enum_protocols.
|
d4d0932 / f8270bb add avio_enum_protocols.
|
||||||
5593f03 deprecate URLProtocol.
|
d4d0932 / 5593f03 deprecate URLProtocol.
|
||||||
c486dad deprecate URLContext.
|
d4d0932 / c486dad deprecate URLContext.
|
||||||
026e175 deprecate the typedef for URLInterruptCB
|
d4d0932 / 026e175 deprecate the typedef for URLInterruptCB
|
||||||
8e76a19 deprecate av_register_protocol2.
|
c88caa5 / 8e76a19 deprecate av_register_protocol2.
|
||||||
b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
|
11d7841 / b840484 deprecate URL_PROTOCOL_FLAG_NESTED_SCHEME
|
||||||
1305d93 deprecate av_url_read_seek
|
11d7841 / 1305d93 deprecate av_url_read_seek
|
||||||
fa104e1 deprecate av_url_read_pause
|
11d7841 / fa104e1 deprecate av_url_read_pause
|
||||||
727c7aa deprecate url_get_filename().
|
434f248 / 727c7aa deprecate url_get_filename().
|
||||||
5958df3 deprecate url_max_packet_size().
|
434f248 / 5958df3 deprecate url_max_packet_size().
|
||||||
1869ea0 deprecate url_get_file_handle().
|
434f248 / 1869ea0 deprecate url_get_file_handle().
|
||||||
32a97d4 deprecate url_filesize().
|
434f248 / 32a97d4 deprecate url_filesize().
|
||||||
e52a914 deprecate url_close().
|
434f248 / e52a914 deprecate url_close().
|
||||||
58a48c6 deprecate url_seek().
|
434f248 / 58a48c6 deprecate url_seek().
|
||||||
925e908 deprecate url_write().
|
434f248 / 925e908 deprecate url_write().
|
||||||
dce3756 deprecate url_read_complete().
|
434f248 / dce3756 deprecate url_read_complete().
|
||||||
bc371ac deprecate url_read().
|
434f248 / bc371ac deprecate url_read().
|
||||||
0589da0 deprecate url_open().
|
434f248 / 0589da0 deprecate url_open().
|
||||||
62eaaea deprecate url_connect.
|
434f248 / 62eaaea deprecate url_connect.
|
||||||
5652bb9 deprecate url_alloc.
|
434f248 / 5652bb9 deprecate url_alloc.
|
||||||
333e894 deprecate url_open_protocol
|
434f248 / 333e894 deprecate url_open_protocol
|
||||||
e230705 deprecate url_poll and URLPollEntry
|
434f248 / e230705 deprecate url_poll and URLPollEntry
|
||||||
|
|
||||||
2011-04-08 - lavf 52.106.0 - avformat.h
|
2011-04-08 - lavf 52.106.0 - avformat.h
|
||||||
Minor avformat.h cleanup:
|
Minor avformat.h cleanup:
|
||||||
a9bf9d8 deprecate av_guess_image2_codec
|
d4d0932 / a9bf9d8 deprecate av_guess_image2_codec
|
||||||
c3675df rename avf_sdp_create->av_sdp_create
|
d4d0932 / c3675df rename avf_sdp_create->av_sdp_create
|
||||||
|
|
||||||
2011-04-03 - lavf 52.105.0 - avio.h
|
2011-04-03 - lavf 52.105.0 - avio.h
|
||||||
Large-scale renaming/deprecating of AVIOContext-related functions:
|
Large-scale renaming/deprecating of AVIOContext-related functions:
|
||||||
724f6a0 deprecate url_fdopen
|
2cae980 / 724f6a0 deprecate url_fdopen
|
||||||
403ee83 deprecate url_open_dyn_packet_buf
|
2cae980 / 403ee83 deprecate url_open_dyn_packet_buf
|
||||||
6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
|
2cae980 / 6dc7d80 rename url_close_dyn_buf -> avio_close_dyn_buf
|
||||||
b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
|
2cae980 / b92c545 rename url_open_dyn_buf -> avio_open_dyn_buf
|
||||||
8978fed introduce an AVIOContext.seekable field as a replacement for
|
2cae980 / 8978fed introduce an AVIOContext.seekable field as a replacement for
|
||||||
AVIOContext.is_streamed and url_is_streamed()
|
AVIOContext.is_streamed and url_is_streamed()
|
||||||
b64030f deprecate get_checksum()
|
1caa412 / b64030f deprecate get_checksum()
|
||||||
4c4427a deprecate init_checksum()
|
1caa412 / 4c4427a deprecate init_checksum()
|
||||||
4ec153b deprecate udp_set_remote_url/get_local_port
|
2fd41c9 / 4ec153b deprecate udp_set_remote_url/get_local_port
|
||||||
933e90a deprecate av_url_read_fseek/fpause
|
4fa0e24 / 933e90a deprecate av_url_read_fseek/fpause
|
||||||
8d9769a deprecate url_fileno
|
4fa0e24 / 8d9769a deprecate url_fileno
|
||||||
b7f2fdd rename put_flush_packet -> avio_flush
|
0fecf26 / b7f2fdd rename put_flush_packet -> avio_flush
|
||||||
35f1023 deprecate url_close_buf
|
0fecf26 / 35f1023 deprecate url_close_buf
|
||||||
83fddae deprecate url_open_buf
|
0fecf26 / 83fddae deprecate url_open_buf
|
||||||
d9d86e0 rename url_fprintf -> avio_printf
|
0fecf26 / d9d86e0 rename url_fprintf -> avio_printf
|
||||||
59f65d9 deprecate url_setbufsize
|
0fecf26 / 59f65d9 deprecate url_setbufsize
|
||||||
3e68b3b deprecate url_ferror
|
6947b0c / 3e68b3b deprecate url_ferror
|
||||||
e8bb2e2 deprecate url_fget_max_packet_size
|
e8bb2e2 deprecate url_fget_max_packet_size
|
||||||
76aa876 rename url_fsize -> avio_size
|
76aa876 rename url_fsize -> avio_size
|
||||||
e519753 deprecate url_fgetc
|
e519753 deprecate url_fgetc
|
||||||
@@ -605,7 +605,7 @@ API changes, most recent first:
|
|||||||
b3db9ce deprecate get_partial_buffer
|
b3db9ce deprecate get_partial_buffer
|
||||||
8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
|
8d9ac96 rename av_alloc_put_byte -> avio_alloc_context
|
||||||
|
|
||||||
2011-03-25 - 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
|
2011-03-25 - 27ef7b1 / 34b47d7 - lavc 52.115.0 - AVCodecContext.audio_service_type
|
||||||
Add audio_service_type field to AVCodecContext.
|
Add audio_service_type field to AVCodecContext.
|
||||||
|
|
||||||
2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h
|
2011-03-17 - e309fdc - lavu 50.40.0 - pixfmt.h
|
||||||
@@ -643,11 +643,11 @@ API changes, most recent first:
|
|||||||
2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
|
2011-02-10 - 12c14cd - lavf 52.99.0 - AVStream.disposition
|
||||||
Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
|
Add AV_DISPOSITION_HEARING_IMPAIRED and AV_DISPOSITION_VISUAL_IMPAIRED.
|
||||||
|
|
||||||
2011-02-09 - 5592734 - lavc 52.112.0 - avcodec_thread_init()
|
2011-02-09 - c0b102c - lavc 52.112.0 - avcodec_thread_init()
|
||||||
Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
|
Deprecate avcodec_thread_init()/avcodec_thread_free() use; instead
|
||||||
set thread_count before calling avcodec_open.
|
set thread_count before calling avcodec_open.
|
||||||
|
|
||||||
2011-02-09 - 778b08a - lavc 52.111.0 - threading API
|
2011-02-09 - 37b00b4 - lavc 52.111.0 - threading API
|
||||||
Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
|
Add CODEC_CAP_FRAME_THREADS with new restrictions on get_buffer()/
|
||||||
release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
|
release_buffer()/draw_horiz_band() callbacks for appropriate codecs.
|
||||||
Add thread_type and active_thread_type fields to AVCodecContext.
|
Add thread_type and active_thread_type fields to AVCodecContext.
|
||||||
|
@@ -35,7 +35,7 @@ GENTEXI = format codec
|
|||||||
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
|
GENTEXI := $(GENTEXI:%=doc/avoptions_%.texi)
|
||||||
|
|
||||||
$(GENTEXI): TAG = GENTEXI
|
$(GENTEXI): TAG = GENTEXI
|
||||||
$(GENTEXI): doc/avoptions_%.texi: doc/print_options
|
$(GENTEXI): doc/avoptions_%.texi: doc/print_options$(HOSTEXESUF)
|
||||||
$(M)doc/print_options $* > $@
|
$(M)doc/print_options $* > $@
|
||||||
|
|
||||||
doc/%.html: TAG = HTML
|
doc/%.html: TAG = HTML
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
Release Notes
|
Release Notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
* 0.10 "Freedom" January, 2012
|
* 0.11 "Happiness" May, 2012
|
||||||
|
|
||||||
|
|
||||||
General notes
|
General notes
|
||||||
|
@@ -340,6 +340,10 @@ prefix is ``ffmpeg2pass''. The complete file name will be
|
|||||||
@file{PREFIX-N.log}, where N is a number specific to the output
|
@file{PREFIX-N.log}, where N is a number specific to the output
|
||||||
stream
|
stream
|
||||||
|
|
||||||
|
Note that this option is overwritten by a local option of the same name
|
||||||
|
when using @code{-vcodec libx264}. That option maps to the x264 option stats
|
||||||
|
which has a different syntax.
|
||||||
|
|
||||||
@item -vlang @var{code}
|
@item -vlang @var{code}
|
||||||
Set the ISO 639 language code (3 letters) of the current video stream.
|
Set the ISO 639 language code (3 letters) of the current video stream.
|
||||||
|
|
||||||
|
9
ffmpeg.c
9
ffmpeg.c
@@ -1456,8 +1456,11 @@ static void term_init(void)
|
|||||||
#if HAVE_TERMIOS_H
|
#if HAVE_TERMIOS_H
|
||||||
if(!run_as_daemon){
|
if(!run_as_daemon){
|
||||||
struct termios tty;
|
struct termios tty;
|
||||||
|
int istty = 1;
|
||||||
if (tcgetattr (0, &tty) == 0) {
|
#if HAVE_ISATTY
|
||||||
|
istty = isatty(0) && isatty(2);
|
||||||
|
#endif
|
||||||
|
if (istty && tcgetattr (0, &tty) == 0) {
|
||||||
oldtty = tty;
|
oldtty = tty;
|
||||||
restore_tty = 1;
|
restore_tty = 1;
|
||||||
atexit(term_exit);
|
atexit(term_exit);
|
||||||
@@ -4700,9 +4703,11 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in
|
|||||||
if (do_pass) {
|
if (do_pass) {
|
||||||
if (do_pass & 1) {
|
if (do_pass & 1) {
|
||||||
video_enc->flags |= CODEC_FLAG_PASS1;
|
video_enc->flags |= CODEC_FLAG_PASS1;
|
||||||
|
av_dict_set(&ost->opts, "flags", "+pass1", AV_DICT_APPEND);
|
||||||
}
|
}
|
||||||
if (do_pass & 2) {
|
if (do_pass & 2) {
|
||||||
video_enc->flags |= CODEC_FLAG_PASS2;
|
video_enc->flags |= CODEC_FLAG_PASS2;
|
||||||
|
av_dict_set(&ost->opts, "flags", "+pass2", AV_DICT_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
117
ffplay.c
117
ffplay.c
@@ -232,6 +232,7 @@ typedef struct VideoState {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int refresh;
|
int refresh;
|
||||||
|
int last_video_stream, last_audio_stream, last_subtitle_stream;
|
||||||
} VideoState;
|
} VideoState;
|
||||||
|
|
||||||
typedef struct AllocEventProps {
|
typedef struct AllocEventProps {
|
||||||
@@ -303,13 +304,12 @@ void av_noreturn exit_program(int ret)
|
|||||||
exit(ret);
|
exit(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
|
static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt)
|
||||||
{
|
{
|
||||||
AVPacketList *pkt1;
|
AVPacketList *pkt1;
|
||||||
|
|
||||||
/* duplicate the packet */
|
if (q->abort_request)
|
||||||
if (pkt != &flush_pkt && av_dup_packet(pkt) < 0)
|
return -1;
|
||||||
return -1;
|
|
||||||
|
|
||||||
pkt1 = av_malloc(sizeof(AVPacketList));
|
pkt1 = av_malloc(sizeof(AVPacketList));
|
||||||
if (!pkt1)
|
if (!pkt1)
|
||||||
@@ -317,11 +317,7 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
|
|||||||
pkt1->pkt = *pkt;
|
pkt1->pkt = *pkt;
|
||||||
pkt1->next = NULL;
|
pkt1->next = NULL;
|
||||||
|
|
||||||
|
|
||||||
SDL_LockMutex(q->mutex);
|
|
||||||
|
|
||||||
if (!q->last_pkt)
|
if (!q->last_pkt)
|
||||||
|
|
||||||
q->first_pkt = pkt1;
|
q->first_pkt = pkt1;
|
||||||
else
|
else
|
||||||
q->last_pkt->next = pkt1;
|
q->last_pkt->next = pkt1;
|
||||||
@@ -330,18 +326,34 @@ static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
|
|||||||
q->size += pkt1->pkt.size + sizeof(*pkt1);
|
q->size += pkt1->pkt.size + sizeof(*pkt1);
|
||||||
/* XXX: should duplicate packet data in DV case */
|
/* XXX: should duplicate packet data in DV case */
|
||||||
SDL_CondSignal(q->cond);
|
SDL_CondSignal(q->cond);
|
||||||
|
|
||||||
SDL_UnlockMutex(q->mutex);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int packet_queue_put(PacketQueue *q, AVPacket *pkt)
|
||||||
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
/* duplicate the packet */
|
||||||
|
if (pkt != &flush_pkt && av_dup_packet(pkt) < 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
SDL_LockMutex(q->mutex);
|
||||||
|
ret = packet_queue_put_private(q, pkt);
|
||||||
|
SDL_UnlockMutex(q->mutex);
|
||||||
|
|
||||||
|
if (pkt != &flush_pkt && ret < 0)
|
||||||
|
av_free_packet(pkt);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* packet queue handling */
|
/* packet queue handling */
|
||||||
static void packet_queue_init(PacketQueue *q)
|
static void packet_queue_init(PacketQueue *q)
|
||||||
{
|
{
|
||||||
memset(q, 0, sizeof(PacketQueue));
|
memset(q, 0, sizeof(PacketQueue));
|
||||||
q->mutex = SDL_CreateMutex();
|
q->mutex = SDL_CreateMutex();
|
||||||
q->cond = SDL_CreateCond();
|
q->cond = SDL_CreateCond();
|
||||||
packet_queue_put(q, &flush_pkt);
|
q->abort_request = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void packet_queue_flush(PacketQueue *q)
|
static void packet_queue_flush(PacketQueue *q)
|
||||||
@@ -361,7 +373,7 @@ static void packet_queue_flush(PacketQueue *q)
|
|||||||
SDL_UnlockMutex(q->mutex);
|
SDL_UnlockMutex(q->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void packet_queue_end(PacketQueue *q)
|
static void packet_queue_destroy(PacketQueue *q)
|
||||||
{
|
{
|
||||||
packet_queue_flush(q);
|
packet_queue_flush(q);
|
||||||
SDL_DestroyMutex(q->mutex);
|
SDL_DestroyMutex(q->mutex);
|
||||||
@@ -379,6 +391,14 @@ static void packet_queue_abort(PacketQueue *q)
|
|||||||
SDL_UnlockMutex(q->mutex);
|
SDL_UnlockMutex(q->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void packet_queue_start(PacketQueue *q)
|
||||||
|
{
|
||||||
|
SDL_LockMutex(q->mutex);
|
||||||
|
q->abort_request = 0;
|
||||||
|
packet_queue_put_private(q, &flush_pkt);
|
||||||
|
SDL_UnlockMutex(q->mutex);
|
||||||
|
}
|
||||||
|
|
||||||
/* return < 0 if aborted, 0 if no packet and > 0 if packet. */
|
/* return < 0 if aborted, 0 if no packet and > 0 if packet. */
|
||||||
static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block)
|
static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block)
|
||||||
{
|
{
|
||||||
@@ -877,6 +897,9 @@ static void stream_close(VideoState *is)
|
|||||||
is->abort_request = 1;
|
is->abort_request = 1;
|
||||||
SDL_WaitThread(is->read_tid, NULL);
|
SDL_WaitThread(is->read_tid, NULL);
|
||||||
SDL_WaitThread(is->refresh_tid, NULL);
|
SDL_WaitThread(is->refresh_tid, NULL);
|
||||||
|
packet_queue_destroy(&is->videoq);
|
||||||
|
packet_queue_destroy(&is->audioq);
|
||||||
|
packet_queue_destroy(&is->subtitleq);
|
||||||
|
|
||||||
/* free all pictures */
|
/* free all pictures */
|
||||||
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
|
for (i = 0; i < VIDEO_PICTURE_QUEUE_SIZE; i++) {
|
||||||
@@ -1816,8 +1839,13 @@ static int video_thread(void *arg)
|
|||||||
int last_w = is->video_st->codec->width;
|
int last_w = is->video_st->codec->width;
|
||||||
int last_h = is->video_st->codec->height;
|
int last_h = is->video_st->codec->height;
|
||||||
|
|
||||||
if ((ret = configure_video_filters(graph, is, vfilters)) < 0)
|
if ((ret = configure_video_filters(graph, is, vfilters)) < 0) {
|
||||||
|
SDL_Event event;
|
||||||
|
event.type = FF_QUIT_EVENT;
|
||||||
|
event.user.data1 = is;
|
||||||
|
SDL_PushEvent(&event);
|
||||||
goto the_end;
|
goto the_end;
|
||||||
|
}
|
||||||
filt_out = is->out_video_filter;
|
filt_out = is->out_video_filter;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -1893,6 +1921,7 @@ static int video_thread(void *arg)
|
|||||||
stream_toggle_pause(is);
|
stream_toggle_pause(is);
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
|
avcodec_flush_buffers(is->video_st->codec);
|
||||||
#if CONFIG_AVFILTER
|
#if CONFIG_AVFILTER
|
||||||
av_freep(&vfilters);
|
av_freep(&vfilters);
|
||||||
avfilter_graph_free(&graph);
|
avfilter_graph_free(&graph);
|
||||||
@@ -2240,9 +2269,9 @@ static int stream_component_open(VideoState *is, int stream_index)
|
|||||||
opts = filter_codec_opts(codec_opts, codec, ic, ic->streams[stream_index]);
|
opts = filter_codec_opts(codec_opts, codec, ic, ic->streams[stream_index]);
|
||||||
|
|
||||||
switch(avctx->codec_type){
|
switch(avctx->codec_type){
|
||||||
case AVMEDIA_TYPE_AUDIO : if(audio_codec_name ) codec= avcodec_find_decoder_by_name( audio_codec_name); break;
|
case AVMEDIA_TYPE_AUDIO : is->last_audio_stream = stream_index; if(audio_codec_name ) codec= avcodec_find_decoder_by_name( audio_codec_name); break;
|
||||||
case AVMEDIA_TYPE_SUBTITLE: if(subtitle_codec_name) codec= avcodec_find_decoder_by_name(subtitle_codec_name); break;
|
case AVMEDIA_TYPE_SUBTITLE: is->last_subtitle_stream = stream_index; if(subtitle_codec_name) codec= avcodec_find_decoder_by_name(subtitle_codec_name); break;
|
||||||
case AVMEDIA_TYPE_VIDEO : if(video_codec_name ) codec= avcodec_find_decoder_by_name( video_codec_name); break;
|
case AVMEDIA_TYPE_VIDEO : is->last_video_stream = stream_index; if(video_codec_name ) codec= avcodec_find_decoder_by_name( video_codec_name); break;
|
||||||
}
|
}
|
||||||
if (!codec)
|
if (!codec)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -2343,20 +2372,20 @@ static int stream_component_open(VideoState *is, int stream_index)
|
|||||||
is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / wanted_spec.freq;
|
is->audio_diff_threshold = 2.0 * SDL_AUDIO_BUFFER_SIZE / wanted_spec.freq;
|
||||||
|
|
||||||
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
|
memset(&is->audio_pkt, 0, sizeof(is->audio_pkt));
|
||||||
packet_queue_init(&is->audioq);
|
packet_queue_start(&is->audioq);
|
||||||
SDL_PauseAudio(0);
|
SDL_PauseAudio(0);
|
||||||
break;
|
break;
|
||||||
case AVMEDIA_TYPE_VIDEO:
|
case AVMEDIA_TYPE_VIDEO:
|
||||||
is->video_stream = stream_index;
|
is->video_stream = stream_index;
|
||||||
is->video_st = ic->streams[stream_index];
|
is->video_st = ic->streams[stream_index];
|
||||||
|
|
||||||
packet_queue_init(&is->videoq);
|
packet_queue_start(&is->videoq);
|
||||||
is->video_tid = SDL_CreateThread(video_thread, is);
|
is->video_tid = SDL_CreateThread(video_thread, is);
|
||||||
break;
|
break;
|
||||||
case AVMEDIA_TYPE_SUBTITLE:
|
case AVMEDIA_TYPE_SUBTITLE:
|
||||||
is->subtitle_stream = stream_index;
|
is->subtitle_stream = stream_index;
|
||||||
is->subtitle_st = ic->streams[stream_index];
|
is->subtitle_st = ic->streams[stream_index];
|
||||||
packet_queue_init(&is->subtitleq);
|
packet_queue_start(&is->subtitleq);
|
||||||
|
|
||||||
is->subtitle_tid = SDL_CreateThread(subtitle_thread, is);
|
is->subtitle_tid = SDL_CreateThread(subtitle_thread, is);
|
||||||
break;
|
break;
|
||||||
@@ -2381,7 +2410,7 @@ static void stream_component_close(VideoState *is, int stream_index)
|
|||||||
|
|
||||||
SDL_CloseAudio();
|
SDL_CloseAudio();
|
||||||
|
|
||||||
packet_queue_end(&is->audioq);
|
packet_queue_flush(&is->audioq);
|
||||||
av_free_packet(&is->audio_pkt);
|
av_free_packet(&is->audio_pkt);
|
||||||
if (is->swr_ctx)
|
if (is->swr_ctx)
|
||||||
swr_free(&is->swr_ctx);
|
swr_free(&is->swr_ctx);
|
||||||
@@ -2407,7 +2436,7 @@ static void stream_component_close(VideoState *is, int stream_index)
|
|||||||
|
|
||||||
SDL_WaitThread(is->video_tid, NULL);
|
SDL_WaitThread(is->video_tid, NULL);
|
||||||
|
|
||||||
packet_queue_end(&is->videoq);
|
packet_queue_flush(&is->videoq);
|
||||||
break;
|
break;
|
||||||
case AVMEDIA_TYPE_SUBTITLE:
|
case AVMEDIA_TYPE_SUBTITLE:
|
||||||
packet_queue_abort(&is->subtitleq);
|
packet_queue_abort(&is->subtitleq);
|
||||||
@@ -2422,7 +2451,7 @@ static void stream_component_close(VideoState *is, int stream_index)
|
|||||||
|
|
||||||
SDL_WaitThread(is->subtitle_tid, NULL);
|
SDL_WaitThread(is->subtitle_tid, NULL);
|
||||||
|
|
||||||
packet_queue_end(&is->subtitleq);
|
packet_queue_flush(&is->subtitleq);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@@ -2469,9 +2498,9 @@ static int read_thread(void *arg)
|
|||||||
int orig_nb_streams;
|
int orig_nb_streams;
|
||||||
|
|
||||||
memset(st_index, -1, sizeof(st_index));
|
memset(st_index, -1, sizeof(st_index));
|
||||||
is->video_stream = -1;
|
is->last_video_stream = is->video_stream = -1;
|
||||||
is->audio_stream = -1;
|
is->last_audio_stream = is->audio_stream = -1;
|
||||||
is->subtitle_stream = -1;
|
is->last_subtitle_stream = is->subtitle_stream = -1;
|
||||||
|
|
||||||
ic = avformat_alloc_context();
|
ic = avformat_alloc_context();
|
||||||
ic->interrupt_callback.callback = decode_interrupt_cb;
|
ic->interrupt_callback.callback = decode_interrupt_cb;
|
||||||
@@ -2625,9 +2654,9 @@ static int read_thread(void *arg)
|
|||||||
|
|
||||||
/* if the queue are full, no need to read more */
|
/* if the queue are full, no need to read more */
|
||||||
if ( is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE
|
if ( is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE
|
||||||
|| ( (is->audioq .nb_packets > MIN_FRAMES || is->audio_stream < 0)
|
|| ( (is->audioq .nb_packets > MIN_FRAMES || is->audio_stream < 0 || is->audioq.abort_request)
|
||||||
&& (is->videoq .nb_packets > MIN_FRAMES || is->video_stream < 0)
|
&& (is->videoq .nb_packets > MIN_FRAMES || is->video_stream < 0 || is->videoq.abort_request)
|
||||||
&& (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream < 0))) {
|
&& (is->subtitleq.nb_packets > MIN_FRAMES || is->subtitle_stream < 0 || is->subtitleq.abort_request))) {
|
||||||
/* wait 10 ms */
|
/* wait 10 ms */
|
||||||
SDL_Delay(10);
|
SDL_Delay(10);
|
||||||
continue;
|
continue;
|
||||||
@@ -2732,6 +2761,10 @@ static VideoState *stream_open(const char *filename, AVInputFormat *iformat)
|
|||||||
is->subpq_mutex = SDL_CreateMutex();
|
is->subpq_mutex = SDL_CreateMutex();
|
||||||
is->subpq_cond = SDL_CreateCond();
|
is->subpq_cond = SDL_CreateCond();
|
||||||
|
|
||||||
|
packet_queue_init(&is->videoq);
|
||||||
|
packet_queue_init(&is->audioq);
|
||||||
|
packet_queue_init(&is->subtitleq);
|
||||||
|
|
||||||
is->av_sync_type = av_sync_type;
|
is->av_sync_type = av_sync_type;
|
||||||
is->read_tid = SDL_CreateThread(read_thread, is);
|
is->read_tid = SDL_CreateThread(read_thread, is);
|
||||||
if (!is->read_tid) {
|
if (!is->read_tid) {
|
||||||
@@ -2745,16 +2778,19 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
|
|||||||
{
|
{
|
||||||
AVFormatContext *ic = is->ic;
|
AVFormatContext *ic = is->ic;
|
||||||
int start_index, stream_index;
|
int start_index, stream_index;
|
||||||
|
int old_index;
|
||||||
AVStream *st;
|
AVStream *st;
|
||||||
|
|
||||||
if (codec_type == AVMEDIA_TYPE_VIDEO)
|
if (codec_type == AVMEDIA_TYPE_VIDEO) {
|
||||||
start_index = is->video_stream;
|
start_index = is->last_video_stream;
|
||||||
else if (codec_type == AVMEDIA_TYPE_AUDIO)
|
old_index = is->video_stream;
|
||||||
start_index = is->audio_stream;
|
} else if (codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
else
|
start_index = is->last_audio_stream;
|
||||||
start_index = is->subtitle_stream;
|
old_index = is->audio_stream;
|
||||||
if (start_index < (codec_type == AVMEDIA_TYPE_SUBTITLE ? -1 : 0))
|
} else {
|
||||||
return;
|
start_index = is->last_subtitle_stream;
|
||||||
|
old_index = is->subtitle_stream;
|
||||||
|
}
|
||||||
stream_index = start_index;
|
stream_index = start_index;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if (++stream_index >= is->ic->nb_streams)
|
if (++stream_index >= is->ic->nb_streams)
|
||||||
@@ -2762,9 +2798,12 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
|
|||||||
if (codec_type == AVMEDIA_TYPE_SUBTITLE)
|
if (codec_type == AVMEDIA_TYPE_SUBTITLE)
|
||||||
{
|
{
|
||||||
stream_index = -1;
|
stream_index = -1;
|
||||||
|
is->last_subtitle_stream = -1;
|
||||||
goto the_end;
|
goto the_end;
|
||||||
} else
|
}
|
||||||
stream_index = 0;
|
if (start_index == -1)
|
||||||
|
return;
|
||||||
|
stream_index = 0;
|
||||||
}
|
}
|
||||||
if (stream_index == start_index)
|
if (stream_index == start_index)
|
||||||
return;
|
return;
|
||||||
@@ -2786,7 +2825,7 @@ static void stream_cycle_channel(VideoState *is, int codec_type)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
the_end:
|
the_end:
|
||||||
stream_component_close(is, start_index);
|
stream_component_close(is, old_index);
|
||||||
stream_component_open(is, stream_index);
|
stream_component_open(is, stream_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -47,7 +47,7 @@ typedef struct EightSvxContext {
|
|||||||
/* buffer used to store the whole audio decoded/interleaved chunk,
|
/* buffer used to store the whole audio decoded/interleaved chunk,
|
||||||
* which is sent with the first packet */
|
* which is sent with the first packet */
|
||||||
uint8_t *samples;
|
uint8_t *samples;
|
||||||
size_t samples_size;
|
int64_t samples_size;
|
||||||
int samples_idx;
|
int samples_idx;
|
||||||
} EightSvxContext;
|
} EightSvxContext;
|
||||||
|
|
||||||
|
@@ -188,7 +188,7 @@ OBJS-$(CONFIG_FRAPS_DECODER) += fraps.o
|
|||||||
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
OBJS-$(CONFIG_FRWU_DECODER) += frwu.o
|
||||||
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
|
OBJS-$(CONFIG_G723_1_DECODER) += g723_1.o acelp_vectors.o \
|
||||||
celp_filters.o celp_math.o
|
celp_filters.o celp_math.o
|
||||||
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o
|
OBJS-$(CONFIG_G723_1_ENCODER) += g723_1.o acelp_vectors.o celp_math.o
|
||||||
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
OBJS-$(CONFIG_G729_DECODER) += g729dec.o lsp.o celp_math.o acelp_filters.o acelp_pitch_delay.o acelp_vectors.o g729postfilter.o
|
||||||
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
OBJS-$(CONFIG_GIF_DECODER) += gifdec.o lzw.o
|
||||||
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
OBJS-$(CONFIG_GIF_ENCODER) += gif.o lzwenc.o
|
||||||
@@ -347,7 +347,7 @@ OBJS-$(CONFIG_PNG_DECODER) += png.o pngdec.o pngdsp.o
|
|||||||
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
OBJS-$(CONFIG_PNG_ENCODER) += png.o pngenc.o
|
||||||
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
OBJS-$(CONFIG_PPM_DECODER) += pnmdec.o pnm.o
|
||||||
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
OBJS-$(CONFIG_PPM_ENCODER) += pnmenc.o pnm.o
|
||||||
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o
|
OBJS-$(CONFIG_PRORES_DECODER) += proresdec2.o proresdsp.o
|
||||||
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o
|
OBJS-$(CONFIG_PRORES_LGPL_DECODER) += proresdec_lgpl.o proresdsp.o proresdata.o
|
||||||
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o
|
OBJS-$(CONFIG_PRORES_ENCODER) += proresenc_anatoliy.o
|
||||||
OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o
|
OBJS-$(CONFIG_PRORES_ANATOLIY_ENCODER) += proresenc_anatoliy.o
|
||||||
@@ -626,6 +626,7 @@ OBJS-$(CONFIG_MATROSKA_DEMUXER) += mpeg4audio.o mpegaudiodata.o
|
|||||||
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
OBJS-$(CONFIG_MATROSKA_MUXER) += xiph.o mpeg4audio.o \
|
||||||
flacdec.o flacdata.o flac.o \
|
flacdec.o flacdata.o flac.o \
|
||||||
mpegaudiodata.o vorbis_data.o
|
mpegaudiodata.o vorbis_data.o
|
||||||
|
OBJS-$(CONFIG_MP2_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
||||||
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
OBJS-$(CONFIG_MP3_MUXER) += mpegaudiodata.o mpegaudiodecheader.o
|
||||||
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o timecode.o
|
OBJS-$(CONFIG_MOV_DEMUXER) += mpeg4audio.o mpegaudiodata.o ac3tab.o timecode.o
|
||||||
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
OBJS-$(CONFIG_MOV_MUXER) += mpeg4audio.o mpegaudiodata.o
|
||||||
|
@@ -878,7 +878,7 @@ static void search_for_quantizers_faac(AVCodecContext *avctx, AACEncContext *s,
|
|||||||
} else {
|
} else {
|
||||||
for (w = 0; w < 8; w++) {
|
for (w = 0; w < 8; w++) {
|
||||||
const float *coeffs = sce->coeffs + w*128;
|
const float *coeffs = sce->coeffs + w*128;
|
||||||
start = 0;
|
curband = start = 0;
|
||||||
for (i = 0; i < 128; i++) {
|
for (i = 0; i < 128; i++) {
|
||||||
if (i - start >= sce->ics.swb_sizes[curband]) {
|
if (i - start >= sce->ics.swb_sizes[curband]) {
|
||||||
start += sce->ics.swb_sizes[curband];
|
start += sce->ics.swb_sizes[curband];
|
||||||
|
@@ -487,6 +487,7 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ac->oc[1].m4ac.chan_config = 2;
|
ac->oc[1].m4ac.chan_config = 2;
|
||||||
|
ac->oc[1].m4ac.ps = 0;
|
||||||
}
|
}
|
||||||
// And vice-versa
|
// And vice-versa
|
||||||
if (!ac->tags_mapped && type == TYPE_SCE && ac->oc[1].m4ac.chan_config == 2) {
|
if (!ac->tags_mapped && type == TYPE_SCE && ac->oc[1].m4ac.chan_config == 2) {
|
||||||
@@ -504,6 +505,8 @@ static ChannelElement *get_che(AACContext *ac, int type, int elem_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
ac->oc[1].m4ac.chan_config = 1;
|
ac->oc[1].m4ac.chan_config = 1;
|
||||||
|
if (ac->oc[1].m4ac.sbr)
|
||||||
|
ac->oc[1].m4ac.ps = -1;
|
||||||
}
|
}
|
||||||
// For indexed channel configurations map the channels solely based on position.
|
// For indexed channel configurations map the channels solely based on position.
|
||||||
switch (ac->oc[1].m4ac.chan_config) {
|
switch (ac->oc[1].m4ac.chan_config) {
|
||||||
|
@@ -1124,7 +1124,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
|||||||
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
|
for (k = 0; k < sbr->n[sbr->data[0].bs_freq_res[e]]; k++) {
|
||||||
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
|
float temp1 = exp2f(sbr->data[0].env_facs[e][k] * alpha + 7.0f);
|
||||||
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
|
float temp2 = exp2f((pan_offset - sbr->data[1].env_facs[e][k]) * alpha);
|
||||||
float fac = temp1 / (1.0f + temp2);
|
float fac;
|
||||||
|
if (temp1 > 1E20) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||||
|
temp1 = 1;
|
||||||
|
}
|
||||||
|
fac = temp1 / (1.0f + temp2);
|
||||||
sbr->data[0].env_facs[e][k] = fac;
|
sbr->data[0].env_facs[e][k] = fac;
|
||||||
sbr->data[1].env_facs[e][k] = fac * temp2;
|
sbr->data[1].env_facs[e][k] = fac * temp2;
|
||||||
}
|
}
|
||||||
@@ -1133,7 +1138,12 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
|||||||
for (k = 0; k < sbr->n_q; k++) {
|
for (k = 0; k < sbr->n_q; k++) {
|
||||||
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
|
float temp1 = exp2f(NOISE_FLOOR_OFFSET - sbr->data[0].noise_facs[e][k] + 1);
|
||||||
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
|
float temp2 = exp2f(12 - sbr->data[1].noise_facs[e][k]);
|
||||||
float fac = temp1 / (1.0f + temp2);
|
float fac;
|
||||||
|
if (temp1 > 1E20) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||||
|
temp1 = 1;
|
||||||
|
}
|
||||||
|
fac = temp1 / (1.0f + temp2);
|
||||||
sbr->data[0].noise_facs[e][k] = fac;
|
sbr->data[0].noise_facs[e][k] = fac;
|
||||||
sbr->data[1].noise_facs[e][k] = fac * temp2;
|
sbr->data[1].noise_facs[e][k] = fac * temp2;
|
||||||
}
|
}
|
||||||
@@ -1142,9 +1152,15 @@ static void sbr_dequant(SpectralBandReplication *sbr, int id_aac)
|
|||||||
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
|
for (ch = 0; ch < (id_aac == TYPE_CPE) + 1; ch++) {
|
||||||
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
|
float alpha = sbr->data[ch].bs_amp_res ? 1.0f : 0.5f;
|
||||||
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
|
for (e = 1; e <= sbr->data[ch].bs_num_env; e++)
|
||||||
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++)
|
for (k = 0; k < sbr->n[sbr->data[ch].bs_freq_res[e]]; k++){
|
||||||
sbr->data[ch].env_facs[e][k] =
|
sbr->data[ch].env_facs[e][k] =
|
||||||
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
|
exp2f(alpha * sbr->data[ch].env_facs[e][k] + 6.0f);
|
||||||
|
if (sbr->data[ch].env_facs[e][k] > 1E20) {
|
||||||
|
av_log(NULL, AV_LOG_ERROR, "envelope scalefactor overflow in dequant\n");
|
||||||
|
sbr->data[ch].env_facs[e][k] = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
|
for (e = 1; e <= sbr->data[ch].bs_num_noise; e++)
|
||||||
for (k = 0; k < sbr->n_q; k++)
|
for (k = 0; k < sbr->n_q; k++)
|
||||||
sbr->data[ch].noise_facs[e][k] =
|
sbr->data[ch].noise_facs[e][k] =
|
||||||
|
@@ -66,7 +66,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
|||||||
const uint8_t *buf = avpkt->data;
|
const uint8_t *buf = avpkt->data;
|
||||||
int buf_size = avpkt->size;
|
int buf_size = avpkt->size;
|
||||||
AascContext *s = avctx->priv_data;
|
AascContext *s = avctx->priv_data;
|
||||||
int compr, i, stride;
|
int compr, i, stride, psize;
|
||||||
|
|
||||||
s->frame.reference = 3;
|
s->frame.reference = 3;
|
||||||
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
|
s->frame.buffer_hints = FF_BUFFER_HINTS_VALID | FF_BUFFER_HINTS_PRESERVE | FF_BUFFER_HINTS_REUSABLE;
|
||||||
@@ -78,6 +78,7 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
|||||||
compr = AV_RL32(buf);
|
compr = AV_RL32(buf);
|
||||||
buf += 4;
|
buf += 4;
|
||||||
buf_size -= 4;
|
buf_size -= 4;
|
||||||
|
psize = avctx->bits_per_coded_sample / 8;
|
||||||
switch (avctx->codec_tag) {
|
switch (avctx->codec_tag) {
|
||||||
case MKTAG('A', 'A', 'S', '4'):
|
case MKTAG('A', 'A', 'S', '4'):
|
||||||
bytestream2_init(&s->gb, buf - 4, buf_size + 4);
|
bytestream2_init(&s->gb, buf - 4, buf_size + 4);
|
||||||
@@ -86,13 +87,13 @@ static int aasc_decode_frame(AVCodecContext *avctx,
|
|||||||
case MKTAG('A', 'A', 'S', 'C'):
|
case MKTAG('A', 'A', 'S', 'C'):
|
||||||
switch(compr){
|
switch(compr){
|
||||||
case 0:
|
case 0:
|
||||||
stride = (avctx->width * 3 + 3) & ~3;
|
stride = (avctx->width * psize + psize) & ~psize;
|
||||||
for(i = avctx->height - 1; i >= 0; i--){
|
for(i = avctx->height - 1; i >= 0; i--){
|
||||||
if(avctx->width*3 > buf_size){
|
if(avctx->width * psize > buf_size){
|
||||||
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
|
av_log(avctx, AV_LOG_ERROR, "Next line is beyond buffer bounds\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width*3);
|
memcpy(s->frame.data[0] + i*s->frame.linesize[0], buf, avctx->width * psize);
|
||||||
buf += stride;
|
buf += stride;
|
||||||
buf_size -= stride;
|
buf_size -= stride;
|
||||||
}
|
}
|
||||||
|
@@ -366,7 +366,7 @@ int ff_ass_split_override_codes(const ASSCodesCallbacks *callbacks, void *priv,
|
|||||||
char new_line[2];
|
char new_line[2];
|
||||||
int text_len = 0;
|
int text_len = 0;
|
||||||
|
|
||||||
while (*buf) {
|
while (buf && *buf) {
|
||||||
if (text && callbacks->text &&
|
if (text && callbacks->text &&
|
||||||
(sscanf(buf, "\\%1[nN]", new_line) == 1 ||
|
(sscanf(buf, "\\%1[nN]", new_line) == 1 ||
|
||||||
!strncmp(buf, "{\\", 2))) {
|
!strncmp(buf, "{\\", 2))) {
|
||||||
|
@@ -48,8 +48,8 @@ static int avui_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
if (pic->data[0])
|
if (pic->data[0])
|
||||||
avctx->release_buffer(avctx, pic);
|
avctx->release_buffer(avctx, pic);
|
||||||
|
|
||||||
if (!memcmp(&avctx->extradata[4], "APRGAPRG0001", 12) &&
|
if (avctx->extradata_size >= 24 &&
|
||||||
avctx->extradata_size >= 24)
|
!memcmp(&avctx->extradata[4], "APRGAPRG0001", 12))
|
||||||
interlaced = avctx->extradata[19] != 1;
|
interlaced = avctx->extradata[19] != 1;
|
||||||
if (avctx->height == 486) {
|
if (avctx->height == 486) {
|
||||||
skip = 10;
|
skip = 10;
|
||||||
|
@@ -107,6 +107,7 @@ AVCodec ff_avui_encoder = {
|
|||||||
.init = avui_encode_init,
|
.init = avui_encode_init,
|
||||||
.encode2 = avui_encode_frame,
|
.encode2 = avui_encode_frame,
|
||||||
.close = avui_encode_close,
|
.close = avui_encode_close,
|
||||||
|
.capabilities = CODEC_CAP_EXPERIMENTAL,
|
||||||
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_UYVY422, PIX_FMT_NONE },
|
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_UYVY422, PIX_FMT_NONE },
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
|
.long_name = NULL_IF_CONFIG_SMALL("Avid Meridien Uncompressed"),
|
||||||
};
|
};
|
||||||
|
@@ -169,7 +169,7 @@ static void init_lengths(BinkContext *c, int width, int bw)
|
|||||||
*
|
*
|
||||||
* @param c decoder context
|
* @param c decoder context
|
||||||
*/
|
*/
|
||||||
static av_cold void init_bundles(BinkContext *c)
|
static av_cold int init_bundles(BinkContext *c)
|
||||||
{
|
{
|
||||||
int bw, bh, blocks;
|
int bw, bh, blocks;
|
||||||
int i;
|
int i;
|
||||||
@@ -180,8 +180,12 @@ static av_cold void init_bundles(BinkContext *c)
|
|||||||
|
|
||||||
for (i = 0; i < BINKB_NB_SRC; i++) {
|
for (i = 0; i < BINKB_NB_SRC; i++) {
|
||||||
c->bundle[i].data = av_malloc(blocks * 64);
|
c->bundle[i].data = av_malloc(blocks * 64);
|
||||||
|
if (!c->bundle[i].data)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
|
c->bundle[i].data_end = c->bundle[i].data + blocks * 64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1128,6 +1132,11 @@ static int bink_decode_plane(BinkContext *c, GetBitContext *gb, int plane_idx,
|
|||||||
xoff = get_value(c, BINK_SRC_X_OFF);
|
xoff = get_value(c, BINK_SRC_X_OFF);
|
||||||
yoff = get_value(c, BINK_SRC_Y_OFF);
|
yoff = get_value(c, BINK_SRC_Y_OFF);
|
||||||
ref = prev + xoff + yoff * stride;
|
ref = prev + xoff + yoff * stride;
|
||||||
|
if (ref < ref_start || ref > ref_end) {
|
||||||
|
av_log(c->avctx, AV_LOG_ERROR, "Copy out of bounds @%d, %d\n",
|
||||||
|
bx*8 + xoff, by*8 + yoff);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
|
c->dsp.put_pixels_tab[1][0](dst, ref, stride, 8);
|
||||||
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
memset(dctblock, 0, sizeof(*dctblock) * 64);
|
||||||
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
|
dctblock[0] = get_value(c, BINK_SRC_INTER_DC);
|
||||||
@@ -1267,7 +1276,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
BinkContext * const c = avctx->priv_data;
|
BinkContext * const c = avctx->priv_data;
|
||||||
static VLC_TYPE table[16 * 128][2];
|
static VLC_TYPE table[16 * 128][2];
|
||||||
static int binkb_initialised = 0;
|
static int binkb_initialised = 0;
|
||||||
int i;
|
int i, ret;
|
||||||
int flags;
|
int flags;
|
||||||
|
|
||||||
c->version = avctx->codec_tag >> 24;
|
c->version = avctx->codec_tag >> 24;
|
||||||
@@ -1302,7 +1311,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
ff_dsputil_init(&c->dsp, avctx);
|
ff_dsputil_init(&c->dsp, avctx);
|
||||||
ff_binkdsp_init(&c->bdsp);
|
ff_binkdsp_init(&c->bdsp);
|
||||||
|
|
||||||
init_bundles(c);
|
if ((ret = init_bundles(c)) < 0) {
|
||||||
|
free_bundles(c);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
if (c->version == 'b') {
|
if (c->version == 'b') {
|
||||||
if (!binkb_initialised) {
|
if (!binkb_initialised) {
|
||||||
|
@@ -91,9 +91,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
frame_len_bits = 11;
|
frame_len_bits = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avctx->channels > MAX_CHANNELS) {
|
if (avctx->channels < 1 || avctx->channels > MAX_CHANNELS) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "too many channels: %d\n", avctx->channels);
|
av_log(avctx, AV_LOG_ERROR, "invalid number of channels: %d\n", avctx->channels);
|
||||||
return -1;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->version_b = avctx->extradata && avctx->extradata[3] == 'b';
|
s->version_b = avctx->extradata && avctx->extradata[3] == 'b';
|
||||||
|
@@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "bytestream.h"
|
#include "bytestream.h"
|
||||||
|
#include "libavutil/avassert.h"
|
||||||
|
|
||||||
enum BMVFlags{
|
enum BMVFlags{
|
||||||
BMV_NOP = 0,
|
BMV_NOP = 0,
|
||||||
@@ -52,7 +53,7 @@ typedef struct BMVDecContext {
|
|||||||
|
|
||||||
static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, int frame_off)
|
static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame, int frame_off)
|
||||||
{
|
{
|
||||||
int val, saved_val = 0;
|
unsigned val, saved_val = 0;
|
||||||
int tmplen = src_len;
|
int tmplen = src_len;
|
||||||
const uint8_t *src, *source_end = source + src_len;
|
const uint8_t *src, *source_end = source + src_len;
|
||||||
uint8_t *frame_end = frame + SCREEN_WIDE * SCREEN_HIGH;
|
uint8_t *frame_end = frame + SCREEN_WIDE * SCREEN_HIGH;
|
||||||
@@ -98,6 +99,8 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
|||||||
}
|
}
|
||||||
if (!(val & 0xC)) {
|
if (!(val & 0xC)) {
|
||||||
for (;;) {
|
for (;;) {
|
||||||
|
if(shift>22)
|
||||||
|
return -1;
|
||||||
if (!read_two_nibbles) {
|
if (!read_two_nibbles) {
|
||||||
if (src < source || src >= source_end)
|
if (src < source || src >= source_end)
|
||||||
return -1;
|
return -1;
|
||||||
@@ -131,6 +134,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
|||||||
}
|
}
|
||||||
advance_mode = val & 1;
|
advance_mode = val & 1;
|
||||||
len = (val >> 1) - 1;
|
len = (val >> 1) - 1;
|
||||||
|
av_assert0(len>0);
|
||||||
mode += 1 + advance_mode;
|
mode += 1 + advance_mode;
|
||||||
if (mode >= 4)
|
if (mode >= 4)
|
||||||
mode -= 3;
|
mode -= 3;
|
||||||
@@ -139,7 +143,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
|||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 1:
|
case 1:
|
||||||
if (forward) {
|
if (forward) {
|
||||||
if (dst - frame + SCREEN_WIDE < frame_off ||
|
if (dst - frame + SCREEN_WIDE < -frame_off ||
|
||||||
frame_end - dst < frame_off + len)
|
frame_end - dst < frame_off + len)
|
||||||
return -1;
|
return -1;
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
@@ -147,7 +151,7 @@ static int decode_bmv_frame(const uint8_t *source, int src_len, uint8_t *frame,
|
|||||||
dst += len;
|
dst += len;
|
||||||
} else {
|
} else {
|
||||||
dst -= len;
|
dst -= len;
|
||||||
if (dst - frame + SCREEN_WIDE < frame_off ||
|
if (dst - frame + SCREEN_WIDE < -frame_off ||
|
||||||
frame_end - dst < frame_off + len)
|
frame_end - dst < frame_off + len)
|
||||||
return -1;
|
return -1;
|
||||||
for (i = len - 1; i >= 0; i--)
|
for (i = len - 1; i >= 0; i--)
|
||||||
@@ -264,6 +268,11 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
c->avctx = avctx;
|
c->avctx = avctx;
|
||||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||||
|
|
||||||
|
if (avctx->width != SCREEN_WIDE || avctx->height != SCREEN_HIGH) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid dimension %dx%d\n", avctx->width, avctx->height);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
c->pic.reference = 1;
|
c->pic.reference = 1;
|
||||||
if (avctx->get_buffer(avctx, &c->pic) < 0) {
|
if (avctx->get_buffer(avctx, &c->pic) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
|
@@ -280,6 +280,10 @@ static int cdg_decode_frame(AVCodecContext *avctx,
|
|||||||
av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
|
av_log(avctx, AV_LOG_ERROR, "buffer too small for decoder\n");
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
|
if (buf_size > CDG_HEADER_SIZE + CDG_DATA_SIZE) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "buffer too big for decoder\n");
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
ret = avctx->reget_buffer(avctx, &cc->frame);
|
ret = avctx->reget_buffer(avctx, &cc->frame);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@@ -25,7 +25,14 @@
|
|||||||
|
|
||||||
#define _WIN32_WINNT 0x0600
|
#define _WIN32_WINNT 0x0600
|
||||||
#define COBJMACROS
|
#define COBJMACROS
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include "dxva2.h"
|
#include "dxva2.h"
|
||||||
|
#if HAVE_DXVA_H
|
||||||
|
#include <dxva.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "avcodec.h"
|
#include "avcodec.h"
|
||||||
#include "mpegvideo.h"
|
#include "mpegvideo.h"
|
||||||
|
|
||||||
|
@@ -48,7 +48,7 @@ typedef struct Escape124Context {
|
|||||||
CodeBook codebooks[3];
|
CodeBook codebooks[3];
|
||||||
} Escape124Context;
|
} Escape124Context;
|
||||||
|
|
||||||
static int can_safely_read(GetBitContext* gb, int bits) {
|
static int can_safely_read(GetBitContext* gb, uint64_t bits) {
|
||||||
return get_bits_left(gb) >= bits;
|
return get_bits_left(gb) >= bits;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,7 +90,7 @@ static CodeBook unpack_codebook(GetBitContext* gb, unsigned depth,
|
|||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
CodeBook cb = { 0 };
|
CodeBook cb = { 0 };
|
||||||
|
|
||||||
if (!can_safely_read(gb, size * 34))
|
if (!can_safely_read(gb, size * 34L))
|
||||||
return cb;
|
return cb;
|
||||||
|
|
||||||
if (size >= INT_MAX / sizeof(MacroBlock))
|
if (size >= INT_MAX / sizeof(MacroBlock))
|
||||||
|
@@ -47,7 +47,7 @@ typedef struct EXRContext {
|
|||||||
AVFrame picture;
|
AVFrame picture;
|
||||||
int compr;
|
int compr;
|
||||||
int bits_per_color_id;
|
int bits_per_color_id;
|
||||||
int8_t channel_offsets[3]; // 0 = red, 1 = green and 2 = blue
|
int8_t channel_offsets[4]; // 0 = red, 1 = green, 2 = blue and 3 = alpha
|
||||||
} EXRContext;
|
} EXRContext;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -170,6 +170,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
s->channel_offsets[0] = -1;
|
s->channel_offsets[0] = -1;
|
||||||
s->channel_offsets[1] = -1;
|
s->channel_offsets[1] = -1;
|
||||||
s->channel_offsets[2] = -1;
|
s->channel_offsets[2] = -1;
|
||||||
|
s->channel_offsets[3] = -1;
|
||||||
s->bits_per_color_id = -1;
|
s->bits_per_color_id = -1;
|
||||||
|
|
||||||
if (buf_end - buf < 10) {
|
if (buf_end - buf < 10) {
|
||||||
@@ -209,6 +210,8 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
channel_index = 1;
|
channel_index = 1;
|
||||||
if (!strcmp(buf, "B"))
|
if (!strcmp(buf, "B"))
|
||||||
channel_index = 2;
|
channel_index = 2;
|
||||||
|
if (!strcmp(buf, "A"))
|
||||||
|
channel_index = 3;
|
||||||
|
|
||||||
while (bytestream_get_byte(&buf) && buf < channel_list_end)
|
while (bytestream_get_byte(&buf) && buf < channel_list_end)
|
||||||
continue; /* skip */
|
continue; /* skip */
|
||||||
@@ -302,9 +305,9 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
if (!variable_buffer_data_size)
|
if (!variable_buffer_data_size)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
switch (*buf) {
|
s->compr = *buf;
|
||||||
|
switch (s->compr) {
|
||||||
case EXR_RAW:
|
case EXR_RAW:
|
||||||
s->compr = *buf;
|
|
||||||
break;
|
break;
|
||||||
case EXR_RLE:
|
case EXR_RLE:
|
||||||
case EXR_ZIP1:
|
case EXR_ZIP1:
|
||||||
@@ -312,7 +315,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
case EXR_PIZ:
|
case EXR_PIZ:
|
||||||
case EXR_B44:
|
case EXR_B44:
|
||||||
default:
|
default:
|
||||||
av_log(avctx, AV_LOG_ERROR, "This type of compression is not supported\n");
|
av_log(avctx, AV_LOG_ERROR, "Compression type %d is not supported\n", s->compr);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,7 +357,10 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
switch (s->bits_per_color_id) {
|
switch (s->bits_per_color_id) {
|
||||||
case 2: // 32-bit
|
case 2: // 32-bit
|
||||||
case 1: // 16-bit
|
case 1: // 16-bit
|
||||||
avctx->pix_fmt = PIX_FMT_RGB48;
|
if (s->channel_offsets[3] >= 0)
|
||||||
|
avctx->pix_fmt = PIX_FMT_RGBA64;
|
||||||
|
else
|
||||||
|
avctx->pix_fmt = PIX_FMT_RGB48;
|
||||||
break;
|
break;
|
||||||
// 8-bit
|
// 8-bit
|
||||||
case 0:
|
case 0:
|
||||||
@@ -390,7 +396,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
// Zero out the start if ymin is not 0
|
// Zero out the start if ymin is not 0
|
||||||
for (y = 0; y < ymin; y++) {
|
for (y = 0; y < ymin; y++) {
|
||||||
memset(ptr, 0, avctx->width * 6);
|
memset(ptr, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
|
||||||
ptr += stride;
|
ptr += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -405,21 +411,27 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
if (line_offset > avpkt->size - xdelta * current_channel_offset) {
|
if (line_offset > avpkt->size - xdelta * current_channel_offset) {
|
||||||
// Line offset is probably wrong and not inside the buffer
|
// Line offset is probably wrong and not inside the buffer
|
||||||
av_log(avctx, AV_LOG_WARNING, "Line offset for line %d is out of reach setting it to black\n", y);
|
av_log(avctx, AV_LOG_WARNING, "Line offset for line %d is out of reach setting it to black\n", y);
|
||||||
memset(ptr_x, 0, avctx->width * 6);
|
memset(ptr_x, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
|
||||||
} else {
|
} else {
|
||||||
const uint8_t *red_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[0];
|
const uint8_t *red_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[0];
|
||||||
const uint8_t *green_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[1];
|
const uint8_t *green_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[1];
|
||||||
const uint8_t *blue_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[2];
|
const uint8_t *blue_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[2];
|
||||||
|
const uint8_t *alpha_channel_buffer = 0;
|
||||||
|
|
||||||
|
if (s->channel_offsets[3] >= 0)
|
||||||
|
alpha_channel_buffer = avpkt->data + line_offset + xdelta * s->channel_offsets[3];
|
||||||
|
|
||||||
// Zero out the start if xmin is not 0
|
// Zero out the start if xmin is not 0
|
||||||
memset(ptr_x, 0, xmin * 6);
|
memset(ptr_x, 0, xmin * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
|
||||||
ptr_x += xmin * 3;
|
ptr_x += xmin * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
|
||||||
if (s->bits_per_color_id == 2) {
|
if (s->bits_per_color_id == 2) {
|
||||||
// 32-bit
|
// 32-bit
|
||||||
for (x = 0; x < xdelta; x++) {
|
for (x = 0; x < xdelta; x++) {
|
||||||
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&red_channel_buffer));
|
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&red_channel_buffer));
|
||||||
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&green_channel_buffer));
|
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&green_channel_buffer));
|
||||||
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&blue_channel_buffer));
|
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&blue_channel_buffer));
|
||||||
|
if (alpha_channel_buffer)
|
||||||
|
*ptr_x++ = exr_flt2uint(bytestream_get_le32(&alpha_channel_buffer));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 16-bit
|
// 16-bit
|
||||||
@@ -427,12 +439,14 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&red_channel_buffer));
|
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&red_channel_buffer));
|
||||||
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&green_channel_buffer));
|
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&green_channel_buffer));
|
||||||
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&blue_channel_buffer));
|
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&blue_channel_buffer));
|
||||||
|
if (alpha_channel_buffer)
|
||||||
|
*ptr_x++ = exr_halflt2uint(bytestream_get_le16(&alpha_channel_buffer));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zero out the end if xmax+1 is not w
|
// Zero out the end if xmax+1 is not w
|
||||||
memset(ptr_x, 0, (avctx->width - (xmax + 1)) * 6);
|
memset(ptr_x, 0, (avctx->width - (xmax + 1)) * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
|
||||||
ptr_x += (avctx->width - (xmax + 1)) * 3;
|
ptr_x += (avctx->width - (xmax + 1)) * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components;
|
||||||
|
|
||||||
}
|
}
|
||||||
// Move to next line
|
// Move to next line
|
||||||
@@ -442,7 +456,7 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
|
|
||||||
// Zero out the end if ymax+1 is not h
|
// Zero out the end if ymax+1 is not h
|
||||||
for (y = ymax + 1; y < avctx->height; y++) {
|
for (y = ymax + 1; y < avctx->height; y++) {
|
||||||
memset(ptr, 0, avctx->width * 6);
|
memset(ptr, 0, avctx->width * 2 * av_pix_fmt_descriptors[avctx->pix_fmt].nb_components);
|
||||||
ptr += stride;
|
ptr += stride;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -228,7 +228,7 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
|
|||||||
mode = !mode;
|
mode = !mode;
|
||||||
}
|
}
|
||||||
//sync line pointers
|
//sync line pointers
|
||||||
while(run_off <= offs){
|
while(offs < width && run_off <= offs){
|
||||||
run_off += *ref++;
|
run_off += *ref++;
|
||||||
run_off += *ref++;
|
run_off += *ref++;
|
||||||
}
|
}
|
||||||
|
@@ -1651,9 +1651,9 @@ static int read_quant_table(RangeCoder *c, int16_t *quant_table, int scale){
|
|||||||
memset(state, 128, sizeof(state));
|
memset(state, 128, sizeof(state));
|
||||||
|
|
||||||
for(v=0; i<128 ; v++){
|
for(v=0; i<128 ; v++){
|
||||||
int len= get_symbol(c, state, 0) + 1;
|
unsigned len= get_symbol(c, state, 0) + 1;
|
||||||
|
|
||||||
if(len + i > 128) return -1;
|
if(len > 128 - i) return -1;
|
||||||
|
|
||||||
while(len--){
|
while(len--){
|
||||||
quant_table[i] = scale*v;
|
quant_table[i] = scale*v;
|
||||||
@@ -1697,8 +1697,10 @@ static int read_extra_header(FFV1Context *f){
|
|||||||
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
ff_build_rac_states(c, 0.05*(1LL<<32), 256-8);
|
||||||
|
|
||||||
f->version= get_symbol(c, state, 0);
|
f->version= get_symbol(c, state, 0);
|
||||||
if(f->version > 2)
|
if(f->version > 2) {
|
||||||
|
c->bytestream_end -= 4;
|
||||||
f->minor_version= get_symbol(c, state, 0);
|
f->minor_version= get_symbol(c, state, 0);
|
||||||
|
}
|
||||||
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
|
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
|
||||||
if(f->ac>1){
|
if(f->ac>1){
|
||||||
for(i=1; i<256; i++){
|
for(i=1; i<256; i++){
|
||||||
@@ -1767,7 +1769,12 @@ static int read_header(FFV1Context *f){
|
|||||||
memset(state, 128, sizeof(state));
|
memset(state, 128, sizeof(state));
|
||||||
|
|
||||||
if(f->version < 2){
|
if(f->version < 2){
|
||||||
f->version= get_symbol(c, state, 0);
|
unsigned v= get_symbol(c, state, 0);
|
||||||
|
if(v >= 2){
|
||||||
|
av_log(f->avctx, AV_LOG_ERROR, "invalid version %d in ver01 header\n", v);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
f->version = v;
|
||||||
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
|
f->ac= f->avctx->coder_type= get_symbol(c, state, 0);
|
||||||
if(f->ac>1){
|
if(f->ac>1){
|
||||||
for(i=1; i<256; i++){
|
for(i=1; i<256; i++){
|
||||||
@@ -1984,7 +1991,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(avctx->debug&FF_DEBUG_PICT_INFO)
|
if(avctx->debug&FF_DEBUG_PICT_INFO)
|
||||||
av_log(avctx, AV_LOG_ERROR, "keyframe:%d coder:%d\n", p->key_frame, f->ac);
|
av_log(avctx, AV_LOG_DEBUG, "ver:%d keyframe:%d coder:%d ec:%d slices:%d\n",
|
||||||
|
f->version, p->key_frame, f->ac, f->ec, f->slice_count);
|
||||||
|
|
||||||
buf_p= buf + buf_size;
|
buf_p= buf + buf_size;
|
||||||
for(i=f->slice_count-1; i>=0; i--){
|
for(i=f->slice_count-1; i>=0; i--){
|
||||||
|
@@ -161,17 +161,17 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
unsigned needed_size = avctx->width*avctx->height*3;
|
unsigned needed_size = avctx->width*avctx->height*3;
|
||||||
if (version == 0) needed_size /= 2;
|
if (version == 0) needed_size /= 2;
|
||||||
needed_size += header_size;
|
needed_size += header_size;
|
||||||
if (buf_size != needed_size && buf_size != header_size) {
|
|
||||||
av_log(avctx, AV_LOG_ERROR,
|
|
||||||
"Invalid frame length %d (should be %d)\n",
|
|
||||||
buf_size, needed_size);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* bit 31 means same as previous pic */
|
/* bit 31 means same as previous pic */
|
||||||
if (header & (1U<<31)) {
|
if (header & (1U<<31)) {
|
||||||
*data_size = 0;
|
*data_size = 0;
|
||||||
return buf_size;
|
return buf_size;
|
||||||
}
|
}
|
||||||
|
if (buf_size != needed_size) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Invalid frame length %d (should be %d)\n",
|
||||||
|
buf_size, needed_size);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* skip frame */
|
/* skip frame */
|
||||||
if (buf_size == 8) {
|
if (buf_size == 8) {
|
||||||
|
@@ -145,6 +145,11 @@ static av_cold int gif_encode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
GIFContext *s = avctx->priv_data;
|
GIFContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
if (avctx->width > 65535 || avctx->height > 65535) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "GIF does not support resolutions above 65535x65535\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
avctx->coded_frame = &s->picture;
|
avctx->coded_frame = &s->picture;
|
||||||
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
s->lzw = av_mallocz(ff_lzw_encode_state_size);
|
||||||
if (!s->lzw)
|
if (!s->lzw)
|
||||||
|
@@ -1615,7 +1615,7 @@ static void decode_postinit(H264Context *h, int setup_finished)
|
|||||||
|| (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
|
|| (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
|
||||||
out_of_order = FFMAX(out_of_order, 1);
|
out_of_order = FFMAX(out_of_order, 1);
|
||||||
if(s->avctx->has_b_frames < out_of_order && !h->sps.bitstream_restriction_flag){
|
if(s->avctx->has_b_frames < out_of_order && !h->sps.bitstream_restriction_flag){
|
||||||
av_log(s->avctx, AV_LOG_WARNING, "Increasing reorder buffer to %d\n", out_of_order);
|
av_log(s->avctx, AV_LOG_VERBOSE, "Increasing reorder buffer to %d\n", out_of_order);
|
||||||
s->avctx->has_b_frames = out_of_order;
|
s->avctx->has_b_frames = out_of_order;
|
||||||
s->low_delay = 0;
|
s->low_delay = 0;
|
||||||
}
|
}
|
||||||
@@ -2719,19 +2719,19 @@ static void init_scan_tables(H264Context *h)
|
|||||||
#undef T
|
#undef T
|
||||||
}
|
}
|
||||||
if (h->sps.transform_bypass) { // FIXME same ugly
|
if (h->sps.transform_bypass) { // FIXME same ugly
|
||||||
h->zigzag_scan_q0 = zigzag_scan;
|
memcpy(h->zigzag_scan_q0 , zigzag_scan , sizeof(h->zigzag_scan_q0 ));
|
||||||
h->zigzag_scan8x8_q0 = ff_zigzag_direct;
|
memcpy(h->zigzag_scan8x8_q0 , ff_zigzag_direct , sizeof(h->zigzag_scan8x8_q0 ));
|
||||||
h->zigzag_scan8x8_cavlc_q0 = zigzag_scan8x8_cavlc;
|
memcpy(h->zigzag_scan8x8_cavlc_q0 , zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
|
||||||
h->field_scan_q0 = field_scan;
|
memcpy(h->field_scan_q0 , field_scan , sizeof(h->field_scan_q0 ));
|
||||||
h->field_scan8x8_q0 = field_scan8x8;
|
memcpy(h->field_scan8x8_q0 , field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
|
||||||
h->field_scan8x8_cavlc_q0 = field_scan8x8_cavlc;
|
memcpy(h->field_scan8x8_cavlc_q0 , field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
|
||||||
} else {
|
} else {
|
||||||
h->zigzag_scan_q0 = h->zigzag_scan;
|
memcpy(h->zigzag_scan_q0 , h->zigzag_scan , sizeof(h->zigzag_scan_q0 ));
|
||||||
h->zigzag_scan8x8_q0 = h->zigzag_scan8x8;
|
memcpy(h->zigzag_scan8x8_q0 , h->zigzag_scan8x8 , sizeof(h->zigzag_scan8x8_q0 ));
|
||||||
h->zigzag_scan8x8_cavlc_q0 = h->zigzag_scan8x8_cavlc;
|
memcpy(h->zigzag_scan8x8_cavlc_q0 , h->zigzag_scan8x8_cavlc , sizeof(h->zigzag_scan8x8_cavlc_q0));
|
||||||
h->field_scan_q0 = h->field_scan;
|
memcpy(h->field_scan_q0 , h->field_scan , sizeof(h->field_scan_q0 ));
|
||||||
h->field_scan8x8_q0 = h->field_scan8x8;
|
memcpy(h->field_scan8x8_q0 , h->field_scan8x8 , sizeof(h->field_scan8x8_q0 ));
|
||||||
h->field_scan8x8_cavlc_q0 = h->field_scan8x8_cavlc;
|
memcpy(h->field_scan8x8_cavlc_q0 , h->field_scan8x8_cavlc , sizeof(h->field_scan8x8_cavlc_q0 ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3133,7 +3133,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
h->mb_mbaff = 0;
|
h->mb_mbaff = 0;
|
||||||
h->mb_aff_frame = 0;
|
h->mb_aff_frame = 0;
|
||||||
last_pic_structure = s0->picture_structure;
|
last_pic_structure = s0->picture_structure;
|
||||||
last_pic_dropable = s->dropable;
|
last_pic_dropable = s0->dropable;
|
||||||
s->dropable = h->nal_ref_idc == 0;
|
s->dropable = h->nal_ref_idc == 0;
|
||||||
if (h->sps.frame_mbs_only_flag) {
|
if (h->sps.frame_mbs_only_flag) {
|
||||||
s->picture_structure = PICT_FRAME;
|
s->picture_structure = PICT_FRAME;
|
||||||
@@ -3251,6 +3251,9 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
|
Picture *prev = h->short_ref_count ? h->short_ref[0] : NULL;
|
||||||
av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
|
av_log(h->s.avctx, AV_LOG_DEBUG, "Frame num gap %d %d\n",
|
||||||
h->frame_num, h->prev_frame_num);
|
h->frame_num, h->prev_frame_num);
|
||||||
|
if (!h->sps.gaps_in_frame_num_allowed_flag)
|
||||||
|
for(i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
|
||||||
|
h->last_pocs[i] = INT_MIN;
|
||||||
if (ff_h264_frame_start(h) < 0)
|
if (ff_h264_frame_start(h) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
h->prev_frame_num++;
|
h->prev_frame_num++;
|
||||||
@@ -4032,7 +4035,9 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg)
|
|||||||
loop_filter(h, lf_x_start, s->mb_x + 1);
|
loop_filter(h, lf_x_start, s->mb_x + 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 2) {
|
if (h->cabac.bytestream > h->cabac.bytestream_end + 2 )
|
||||||
|
av_log(h->s.avctx, AV_LOG_DEBUG, "bytestream overread %td\n", h->cabac.bytestream_end - h->cabac.bytestream);
|
||||||
|
if (ret < 0 || h->cabac.bytestream > h->cabac.bytestream_end + 4) {
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR,
|
av_log(h->s.avctx, AV_LOG_ERROR,
|
||||||
"error while decoding MB %d %d, bytestream (%td)\n",
|
"error while decoding MB %d %d, bytestream (%td)\n",
|
||||||
s->mb_x, s->mb_y,
|
s->mb_x, s->mb_y,
|
||||||
@@ -4399,6 +4404,9 @@ again:
|
|||||||
init_get_bits(&hx->inter_gb, ptr, bit_length);
|
init_get_bits(&hx->inter_gb, ptr, bit_length);
|
||||||
hx->inter_gb_ptr = &hx->inter_gb;
|
hx->inter_gb_ptr = &hx->inter_gb;
|
||||||
|
|
||||||
|
av_log(h->s.avctx, AV_LOG_ERROR, "Partitioned H.264 support is incomplete\n");
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
|
||||||
if (hx->redundant_pic_count == 0 &&
|
if (hx->redundant_pic_count == 0 &&
|
||||||
hx->intra_gb_ptr &&
|
hx->intra_gb_ptr &&
|
||||||
hx->s.data_partitioning &&
|
hx->s.data_partitioning &&
|
||||||
|
@@ -421,12 +421,12 @@ typedef struct H264Context {
|
|||||||
uint8_t field_scan[16];
|
uint8_t field_scan[16];
|
||||||
uint8_t field_scan8x8[64];
|
uint8_t field_scan8x8[64];
|
||||||
uint8_t field_scan8x8_cavlc[64];
|
uint8_t field_scan8x8_cavlc[64];
|
||||||
const uint8_t *zigzag_scan_q0;
|
uint8_t zigzag_scan_q0[16];
|
||||||
const uint8_t *zigzag_scan8x8_q0;
|
uint8_t zigzag_scan8x8_q0[64];
|
||||||
const uint8_t *zigzag_scan8x8_cavlc_q0;
|
uint8_t zigzag_scan8x8_cavlc_q0[64];
|
||||||
const uint8_t *field_scan_q0;
|
uint8_t field_scan_q0[16];
|
||||||
const uint8_t *field_scan8x8_q0;
|
uint8_t field_scan8x8_q0[64];
|
||||||
const uint8_t *field_scan8x8_cavlc_q0;
|
uint8_t field_scan8x8_cavlc_q0[64];
|
||||||
|
|
||||||
int x264_build;
|
int x264_build;
|
||||||
|
|
||||||
|
@@ -513,7 +513,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
|
|||||||
else
|
else
|
||||||
level_code= prefix + get_bits(gb, 4); //part
|
level_code= prefix + get_bits(gb, 4); //part
|
||||||
}else{
|
}else{
|
||||||
level_code= 30 + get_bits(gb, prefix-3); //part
|
level_code= 30;
|
||||||
if(prefix>=16){
|
if(prefix>=16){
|
||||||
if(prefix > 25+3){
|
if(prefix > 25+3){
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR, "Invalid level prefix\n");
|
av_log(h->s.avctx, AV_LOG_ERROR, "Invalid level prefix\n");
|
||||||
@@ -521,6 +521,7 @@ static int decode_residual(H264Context *h, GetBitContext *gb, DCTELEM *block, in
|
|||||||
}
|
}
|
||||||
level_code += (1<<(prefix-3))-4096;
|
level_code += (1<<(prefix-3))-4096;
|
||||||
}
|
}
|
||||||
|
level_code += get_bits(gb, prefix-3); //part
|
||||||
}
|
}
|
||||||
|
|
||||||
if(trailing_ones < 3) level_code += 2;
|
if(trailing_ones < 3) level_code += 2;
|
||||||
|
@@ -287,7 +287,10 @@ int ff_h264_decode_ref_pic_list_reordering(H264Context *h){
|
|||||||
for(list=0; list<h->list_count; list++){
|
for(list=0; list<h->list_count; list++){
|
||||||
for(index= 0; index < h->ref_count[list]; index++){
|
for(index= 0; index < h->ref_count[list]; index++){
|
||||||
if (!h->ref_list[list][index].f.data[0]) {
|
if (!h->ref_list[list][index].f.data[0]) {
|
||||||
av_log(h->s.avctx, AV_LOG_ERROR, "Missing reference picture\n");
|
int i;
|
||||||
|
av_log(h->s.avctx, AV_LOG_ERROR, "Missing reference picture, default is %d\n", h->default_ref_list[list][0].poc);
|
||||||
|
for (i=0; i<FF_ARRAY_ELEMS(h->last_pocs); i++)
|
||||||
|
h->last_pocs[i] = INT_MIN;
|
||||||
if (h->default_ref_list[list][0].f.data[0])
|
if (h->default_ref_list[list][0].f.data[0])
|
||||||
h->ref_list[list][index]= h->default_ref_list[list][0];
|
h->ref_list[list][index]= h->default_ref_list[list][0];
|
||||||
else
|
else
|
||||||
|
@@ -52,14 +52,14 @@ static const uint8_t golomb_to_inter_cbp[48] = {
|
|||||||
17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
|
17, 18, 20, 24, 19, 21, 26, 28, 23, 27, 29, 30, 22, 25, 38, 41
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t zigzag_scan[16] = {
|
static const uint8_t zigzag_scan[16+1] = {
|
||||||
0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
|
0 + 0 * 4, 1 + 0 * 4, 0 + 1 * 4, 0 + 2 * 4,
|
||||||
1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
|
1 + 1 * 4, 2 + 0 * 4, 3 + 0 * 4, 2 + 1 * 4,
|
||||||
1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
|
1 + 2 * 4, 0 + 3 * 4, 1 + 3 * 4, 2 + 2 * 4,
|
||||||
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
|
3 + 1 * 4, 3 + 2 * 4, 2 + 3 * 4, 3 + 3 * 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t field_scan[16] = {
|
static const uint8_t field_scan[16+1] = {
|
||||||
0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
|
0 + 0 * 4, 0 + 1 * 4, 1 + 0 * 4, 0 + 2 * 4,
|
||||||
0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
|
0 + 3 * 4, 1 + 1 * 4, 1 + 2 * 4, 1 + 3 * 4,
|
||||||
2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
|
2 + 0 * 4, 2 + 1 * 4, 2 + 2 * 4, 2 + 3 * 4,
|
||||||
@@ -93,7 +93,7 @@ static const uint8_t chroma422_dc_scan[8] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
|
// zigzag_scan8x8_cavlc[i] = zigzag_scan8x8[(i/4) + 16*(i%4)]
|
||||||
static const uint8_t zigzag_scan8x8_cavlc[64] = {
|
static const uint8_t zigzag_scan8x8_cavlc[64+1] = {
|
||||||
0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
|
0 + 0 * 8, 1 + 1 * 8, 1 + 2 * 8, 2 + 2 * 8,
|
||||||
4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
|
4 + 1 * 8, 0 + 5 * 8, 3 + 3 * 8, 7 + 0 * 8,
|
||||||
3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
|
3 + 4 * 8, 1 + 7 * 8, 5 + 3 * 8, 6 + 3 * 8,
|
||||||
@@ -112,7 +112,7 @@ static const uint8_t zigzag_scan8x8_cavlc[64] = {
|
|||||||
5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
|
5 + 5 * 8, 6 + 5 * 8, 6 + 6 * 8, 7 + 7 * 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t field_scan8x8[64] = {
|
static const uint8_t field_scan8x8[64+1] = {
|
||||||
0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
|
0 + 0 * 8, 0 + 1 * 8, 0 + 2 * 8, 1 + 0 * 8,
|
||||||
1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
|
1 + 1 * 8, 0 + 3 * 8, 0 + 4 * 8, 1 + 2 * 8,
|
||||||
2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
|
2 + 0 * 8, 1 + 3 * 8, 0 + 5 * 8, 0 + 6 * 8,
|
||||||
@@ -131,7 +131,7 @@ static const uint8_t field_scan8x8[64] = {
|
|||||||
7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
|
7 + 4 * 8, 7 + 5 * 8, 7 + 6 * 8, 7 + 7 * 8,
|
||||||
};
|
};
|
||||||
|
|
||||||
static const uint8_t field_scan8x8_cavlc[64] = {
|
static const uint8_t field_scan8x8_cavlc[64+1] = {
|
||||||
0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
|
0 + 0 * 8, 1 + 1 * 8, 2 + 0 * 8, 0 + 7 * 8,
|
||||||
2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
|
2 + 2 * 8, 2 + 3 * 8, 2 + 4 * 8, 3 + 3 * 8,
|
||||||
3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
|
3 + 4 * 8, 4 + 3 * 8, 4 + 4 * 8, 5 + 3 * 8,
|
||||||
|
@@ -314,12 +314,13 @@ static void generate_joint_tables(HYuvContext *s){
|
|||||||
for(i=y=0; y<256; y++){
|
for(i=y=0; y<256; y++){
|
||||||
int len0 = s->len[0][y];
|
int len0 = s->len[0][y];
|
||||||
int limit = VLC_BITS - len0;
|
int limit = VLC_BITS - len0;
|
||||||
if(limit <= 0)
|
if(limit <= 0 || !len0)
|
||||||
continue;
|
continue;
|
||||||
for(u=0; u<256; u++){
|
for(u=0; u<256; u++){
|
||||||
int len1 = s->len[p][u];
|
int len1 = s->len[p][u];
|
||||||
if(len1 > limit)
|
if (len1 > limit || !len1)
|
||||||
continue;
|
continue;
|
||||||
|
av_assert0(i < (1 << VLC_BITS));
|
||||||
len[i] = len0 + len1;
|
len[i] = len0 + len1;
|
||||||
bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
|
bits[i] = (s->bits[0][y] << len1) + s->bits[p][u];
|
||||||
symbols[i] = (y<<8) + u;
|
symbols[i] = (y<<8) + u;
|
||||||
@@ -341,18 +342,19 @@ static void generate_joint_tables(HYuvContext *s){
|
|||||||
for(i=0, g=-16; g<16; g++){
|
for(i=0, g=-16; g<16; g++){
|
||||||
int len0 = s->len[p0][g&255];
|
int len0 = s->len[p0][g&255];
|
||||||
int limit0 = VLC_BITS - len0;
|
int limit0 = VLC_BITS - len0;
|
||||||
if(limit0 < 2)
|
if (limit0 < 2 || !len0)
|
||||||
continue;
|
continue;
|
||||||
for(b=-16; b<16; b++){
|
for(b=-16; b<16; b++){
|
||||||
int len1 = s->len[p1][b&255];
|
int len1 = s->len[p1][b&255];
|
||||||
int limit1 = limit0 - len1;
|
int limit1 = limit0 - len1;
|
||||||
if(limit1 < 1)
|
if (limit1 < 1 || !len1)
|
||||||
continue;
|
continue;
|
||||||
code = (s->bits[p0][g&255] << len1) + s->bits[p1][b&255];
|
code = (s->bits[p0][g&255] << len1) + s->bits[p1][b&255];
|
||||||
for(r=-16; r<16; r++){
|
for(r=-16; r<16; r++){
|
||||||
int len2 = s->len[2][r&255];
|
int len2 = s->len[2][r&255];
|
||||||
if(len2 > limit1)
|
if (len2 > limit1 || !len2)
|
||||||
continue;
|
continue;
|
||||||
|
av_assert0(i < (1 << VLC_BITS));
|
||||||
len[i] = len0 + len1 + len2;
|
len[i] = len0 + len1 + len2;
|
||||||
bits[i] = (code << len2) + s->bits[2][r&255];
|
bits[i] = (code << len2) + s->bits[2][r&255];
|
||||||
if(s->decorrelate){
|
if(s->decorrelate){
|
||||||
@@ -376,6 +378,7 @@ static void generate_joint_tables(HYuvContext *s){
|
|||||||
static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
|
static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
|
int ret;
|
||||||
|
|
||||||
init_get_bits(&gb, src, length*8);
|
init_get_bits(&gb, src, length*8);
|
||||||
|
|
||||||
@@ -386,7 +389,8 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
ff_free_vlc(&s->vlc[i]);
|
ff_free_vlc(&s->vlc[i]);
|
||||||
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
|
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_joint_tables(s);
|
generate_joint_tables(s);
|
||||||
@@ -397,6 +401,7 @@ static int read_huffman_tables(HYuvContext *s, const uint8_t *src, int length){
|
|||||||
static int read_old_huffman_tables(HYuvContext *s){
|
static int read_old_huffman_tables(HYuvContext *s){
|
||||||
GetBitContext gb;
|
GetBitContext gb;
|
||||||
int i;
|
int i;
|
||||||
|
int ret;
|
||||||
|
|
||||||
init_get_bits(&gb, classic_shift_luma, classic_shift_luma_table_size*8);
|
init_get_bits(&gb, classic_shift_luma, classic_shift_luma_table_size*8);
|
||||||
if(read_len_table(s->len[0], &gb)<0)
|
if(read_len_table(s->len[0], &gb)<0)
|
||||||
@@ -417,7 +422,8 @@ static int read_old_huffman_tables(HYuvContext *s){
|
|||||||
|
|
||||||
for(i=0; i<3; i++){
|
for(i=0; i<3; i++){
|
||||||
ff_free_vlc(&s->vlc[i]);
|
ff_free_vlc(&s->vlc[i]);
|
||||||
init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0);
|
if ((ret = init_vlc(&s->vlc[i], VLC_BITS, 256, s->len[i], 1, 1, s->bits[i], 4, 4, 0)) < 0)
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
generate_joint_tables(s);
|
generate_joint_tables(s);
|
||||||
|
@@ -191,7 +191,13 @@ static int extract_header(AVCodecContext *const avctx,
|
|||||||
const uint8_t *buf;
|
const uint8_t *buf;
|
||||||
unsigned buf_size;
|
unsigned buf_size;
|
||||||
IffContext *s = avctx->priv_data;
|
IffContext *s = avctx->priv_data;
|
||||||
int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
int palette_size;
|
||||||
|
|
||||||
|
if (avctx->extradata_size < 2) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "not enough extradata\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
||||||
|
|
||||||
if (avpkt) {
|
if (avpkt) {
|
||||||
int image_size;
|
int image_size;
|
||||||
@@ -207,8 +213,6 @@ static int extract_header(AVCodecContext *const avctx,
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (avctx->extradata_size < 2)
|
|
||||||
return AVERROR_INVALIDDATA;
|
|
||||||
buf = avctx->extradata;
|
buf = avctx->extradata;
|
||||||
buf_size = bytestream_get_be16(&buf);
|
buf_size = bytestream_get_be16(&buf);
|
||||||
if (buf_size <= 1 || palette_size < 0) {
|
if (buf_size <= 1 || palette_size < 0) {
|
||||||
@@ -312,7 +316,12 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (avctx->bits_per_coded_sample <= 8) {
|
if (avctx->bits_per_coded_sample <= 8) {
|
||||||
int palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
int palette_size;
|
||||||
|
|
||||||
|
if (avctx->extradata_size >= 2)
|
||||||
|
palette_size = avctx->extradata_size - AV_RB16(avctx->extradata);
|
||||||
|
else
|
||||||
|
palette_size = 0;
|
||||||
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) ||
|
avctx->pix_fmt = (avctx->bits_per_coded_sample < 8) ||
|
||||||
(avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;
|
(avctx->extradata_size >= 2 && palette_size) ? PIX_FMT_PAL8 : PIX_FMT_GRAY8;
|
||||||
} else if (avctx->bits_per_coded_sample <= 32) {
|
} else if (avctx->bits_per_coded_sample <= 32) {
|
||||||
|
@@ -199,6 +199,10 @@ static int decode_gop_header(IVI45DecContext *ctx, AVCodecContext *avctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (band->blk_size == 8) {
|
if (band->blk_size == 8) {
|
||||||
|
if(quant_mat >= 5){
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "quant_mat %d too large!\n", quant_mat);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
band->intra_base = &ivi5_base_quant_8x8_intra[quant_mat][0];
|
band->intra_base = &ivi5_base_quant_8x8_intra[quant_mat][0];
|
||||||
band->inter_base = &ivi5_base_quant_8x8_inter[quant_mat][0];
|
band->inter_base = &ivi5_base_quant_8x8_inter[quant_mat][0];
|
||||||
band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0];
|
band->intra_scale = &ivi5_scale_quant_8x8_intra[quant_mat][0];
|
||||||
|
@@ -77,7 +77,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s)
|
|||||||
}
|
}
|
||||||
if(get_bits(&s->gb, 2))
|
if(get_bits(&s->gb, 2))
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
|
||||||
s->loop_filter = get_bits1(&s->gb);
|
s->loop_filter = get_bits1(&s->gb) * !s->avctx->lowres;
|
||||||
if(get_bits1(&s->gb))
|
if(get_bits1(&s->gb))
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
|
av_log(s->avctx, AV_LOG_ERROR, "Bad value for reserved field\n");
|
||||||
if(get_bits1(&s->gb))
|
if(get_bits1(&s->gb))
|
||||||
|
@@ -963,6 +963,8 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
|
|||||||
s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
|
s->h263_aic = get_bits1(&s->gb); /* Advanced Intra Coding (AIC) */
|
||||||
s->loop_filter= get_bits1(&s->gb);
|
s->loop_filter= get_bits1(&s->gb);
|
||||||
s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
|
s->unrestricted_mv = s->umvplus || s->obmc || s->loop_filter;
|
||||||
|
if(s->avctx->lowres)
|
||||||
|
s->loop_filter = 0;
|
||||||
|
|
||||||
s->h263_slice_structured= get_bits1(&s->gb);
|
s->h263_slice_structured= get_bits1(&s->gb);
|
||||||
if (get_bits1(&s->gb) != 0) {
|
if (get_bits1(&s->gb) != 0) {
|
||||||
|
@@ -143,6 +143,10 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
buf += 5;
|
buf += 5;
|
||||||
|
|
||||||
if (video_size) {
|
if (video_size) {
|
||||||
|
if(video_size < 0) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "video size %d invalid\n", video_size);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if (avctx->reget_buffer(avctx, &s->frame) < 0) {
|
if (avctx->reget_buffer(avctx, &s->frame) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
return -1;
|
return -1;
|
||||||
|
@@ -304,7 +304,8 @@ AVCodec ff_libmp3lame_encoder = {
|
|||||||
AV_SAMPLE_FMT_NONE },
|
AV_SAMPLE_FMT_NONE },
|
||||||
.supported_samplerates = libmp3lame_sample_rates,
|
.supported_samplerates = libmp3lame_sample_rates,
|
||||||
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
|
.channel_layouts = (const uint64_t[]) { AV_CH_LAYOUT_MONO,
|
||||||
AV_CH_LAYOUT_STEREO },
|
AV_CH_LAYOUT_STEREO,
|
||||||
|
0},
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
|
.long_name = NULL_IF_CONFIG_SMALL("libmp3lame MP3 (MPEG audio layer 3)"),
|
||||||
.priv_class = &libmp3lame_class,
|
.priv_class = &libmp3lame_class,
|
||||||
.defaults = libmp3lame_defaults,
|
.defaults = libmp3lame_defaults,
|
||||||
|
@@ -171,7 +171,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
||||||
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
||||||
X264_TYPE_AUTO;
|
X264_TYPE_AUTO;
|
||||||
if (x4->params.b_tff != frame->top_field_first) {
|
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
|
||||||
x4->params.b_tff = frame->top_field_first;
|
x4->params.b_tff = frame->top_field_first;
|
||||||
x264_encoder_reconfig(x4->enc, &x4->params);
|
x264_encoder_reconfig(x4->enc, &x4->params);
|
||||||
}
|
}
|
||||||
|
@@ -231,7 +231,7 @@ static av_cold int mace_decode_init(AVCodecContext * avctx)
|
|||||||
{
|
{
|
||||||
MACEContext *ctx = avctx->priv_data;
|
MACEContext *ctx = avctx->priv_data;
|
||||||
|
|
||||||
if (avctx->channels > 2)
|
if (avctx->channels > 2 || avctx->channels <= 0)
|
||||||
return -1;
|
return -1;
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||||
|
|
||||||
|
@@ -55,6 +55,11 @@ static av_cold int mp_decode_init(AVCodecContext *avctx)
|
|||||||
int w4 = (avctx->width + 3) & ~3;
|
int w4 = (avctx->width + 3) & ~3;
|
||||||
int h4 = (avctx->height + 3) & ~3;
|
int h4 = (avctx->height + 3) & ~3;
|
||||||
|
|
||||||
|
if(avctx->extradata_size < 2){
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "extradata too small\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
motionpixels_tableinit();
|
motionpixels_tableinit();
|
||||||
mp->avctx = avctx;
|
mp->avctx = avctx;
|
||||||
ff_dsputil_init(&mp->dsp, avctx);
|
ff_dsputil_init(&mp->dsp, avctx);
|
||||||
|
@@ -228,7 +228,7 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
buf_size -= 4;
|
buf_size -= 4;
|
||||||
|
|
||||||
/* get output buffer */
|
/* get output buffer */
|
||||||
c->frame.nb_samples = last_frame ? c->lastframelen : MPC_FRAME_SIZE;
|
c->frame.nb_samples = MPC_FRAME_SIZE;
|
||||||
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
|
if ((ret = avctx->get_buffer(avctx, &c->frame)) < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
return ret;
|
return ret;
|
||||||
@@ -298,6 +298,8 @@ static int mpc7_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off);
|
idx_to_quant(c, &gb, bands[i].res[ch], c->Q[ch] + off);
|
||||||
|
|
||||||
ff_mpc_dequantize_and_synth(c, mb, c->frame.data[0], 2);
|
ff_mpc_dequantize_and_synth(c, mb, c->frame.data[0], 2);
|
||||||
|
if(last_frame)
|
||||||
|
c->frame.nb_samples = c->lastframelen;
|
||||||
|
|
||||||
bits_used = get_bits_count(&gb);
|
bits_used = get_bits_count(&gb);
|
||||||
bits_avail = buf_size * 8;
|
bits_avail = buf_size * 8;
|
||||||
|
@@ -140,7 +140,8 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx)
|
|||||||
c->frames = 1 << (get_bits(&gb, 3) * 2);
|
c->frames = 1 << (get_bits(&gb, 3) * 2);
|
||||||
|
|
||||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
|
||||||
avctx->channel_layout = (avctx->channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
|
avctx->channel_layout = (channels==2) ? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
|
||||||
|
avctx->channels = channels;
|
||||||
|
|
||||||
if(vlc_initialized) return 0;
|
if(vlc_initialized) return 0;
|
||||||
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
|
av_log(avctx, AV_LOG_DEBUG, "Initing VLC\n");
|
||||||
@@ -274,7 +275,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
|
maxband = c->last_max_band + get_vlc2(gb, band_vlc.table, MPC8_BANDS_BITS, 2);
|
||||||
if(maxband > 32) maxband -= 33;
|
if(maxband > 32) maxband -= 33;
|
||||||
}
|
}
|
||||||
if(maxband >= BANDS) {
|
if(maxband > c->maxbands + 1) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "maxband %d too large\n",maxband);
|
av_log(avctx, AV_LOG_ERROR, "maxband %d too large\n",maxband);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
@@ -411,7 +412,8 @@ static int mpc8_decode_frame(AVCodecContext * avctx, void *data,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ff_mpc_dequantize_and_synth(c, maxband, c->frame.data[0], avctx->channels);
|
ff_mpc_dequantize_and_synth(c, maxband - 1, c->frame.data[0],
|
||||||
|
avctx->channels);
|
||||||
|
|
||||||
c->cur_frame++;
|
c->cur_frame++;
|
||||||
|
|
||||||
|
@@ -459,7 +459,7 @@ static av_always_inline void mpeg1_encode_mb_internal(MpegEncContext *s,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
|
if (cbp == 0 && !first_mb && s->mv_type == MV_TYPE_16X16 &&
|
||||||
(mb_x != s->mb_width - 1 || (mb_y != s->mb_height - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
|
(mb_x != s->mb_width - 1 || (mb_y != s->end_mb_y - 1 && s->codec_id == CODEC_ID_MPEG1VIDEO)) &&
|
||||||
((s->pict_type == AV_PICTURE_TYPE_P && (motion_x | motion_y) == 0) ||
|
((s->pict_type == AV_PICTURE_TYPE_P && (motion_x | motion_y) == 0) ||
|
||||||
(s->pict_type == AV_PICTURE_TYPE_B && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
|
(s->pict_type == AV_PICTURE_TYPE_B && s->mv_dir == s->last_mv_dir && (((s->mv_dir & MV_DIR_FORWARD) ? ((s->mv[0][0][0] - s->last_mv[0][0][0])|(s->mv[0][0][1] - s->last_mv[0][0][1])) : 0) |
|
||||||
((s->mv_dir & MV_DIR_BACKWARD) ? ((s->mv[1][0][0] - s->last_mv[1][0][0])|(s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
|
((s->mv_dir & MV_DIR_BACKWARD) ? ((s->mv[1][0][0] - s->last_mv[1][0][0])|(s->mv[1][0][1] - s->last_mv[1][0][1])) : 0)) == 0))) {
|
||||||
@@ -973,7 +973,7 @@ AVCodec ff_mpeg1video_encoder = {
|
|||||||
.supported_framerates = avpriv_frame_rate_tab+1,
|
.supported_framerates = avpriv_frame_rate_tab+1,
|
||||||
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P,
|
.pix_fmts = (const enum PixelFormat[]){ PIX_FMT_YUV420P,
|
||||||
PIX_FMT_NONE },
|
PIX_FMT_NONE },
|
||||||
.capabilities = CODEC_CAP_DELAY,
|
.capabilities = CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS,
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
|
.long_name = NULL_IF_CONFIG_SMALL("MPEG-1 video"),
|
||||||
.priv_class = &mpeg1_class,
|
.priv_class = &mpeg1_class,
|
||||||
};
|
};
|
||||||
|
@@ -2050,6 +2050,10 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
|
|||||||
if(s->pict_type == AV_PICTURE_TYPE_B)
|
if(s->pict_type == AV_PICTURE_TYPE_B)
|
||||||
skip_bits_long(gb, s->cplx_estimation_trash_b);
|
skip_bits_long(gb, s->cplx_estimation_trash_b);
|
||||||
|
|
||||||
|
if(get_bits_left(gb) < 3) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Header truncated\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
s->intra_dc_threshold= ff_mpeg4_dc_threshold[ get_bits(gb, 3) ];
|
s->intra_dc_threshold= ff_mpeg4_dc_threshold[ get_bits(gb, 3) ];
|
||||||
if(!s->progressive_sequence){
|
if(!s->progressive_sequence){
|
||||||
s->top_field_first= get_bits1(gb);
|
s->top_field_first= get_bits1(gb);
|
||||||
|
@@ -29,6 +29,7 @@ typedef struct MpegAudioParseContext {
|
|||||||
int frame_size;
|
int frame_size;
|
||||||
uint32_t header;
|
uint32_t header;
|
||||||
int header_count;
|
int header_count;
|
||||||
|
int no_bitrate;
|
||||||
} MpegAudioParseContext;
|
} MpegAudioParseContext;
|
||||||
|
|
||||||
#define MPA_HEADER_SIZE 4
|
#define MPA_HEADER_SIZE 4
|
||||||
@@ -53,6 +54,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
|||||||
int inc= FFMIN(buf_size - i, s->frame_size);
|
int inc= FFMIN(buf_size - i, s->frame_size);
|
||||||
i += inc;
|
i += inc;
|
||||||
s->frame_size -= inc;
|
s->frame_size -= inc;
|
||||||
|
state = 0;
|
||||||
|
|
||||||
if(!s->frame_size){
|
if(!s->frame_size){
|
||||||
next= i;
|
next= i;
|
||||||
@@ -72,15 +74,18 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
|
|||||||
if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
|
if((state&SAME_HEADER_MASK) != (s->header&SAME_HEADER_MASK) && s->header)
|
||||||
s->header_count= -3;
|
s->header_count= -3;
|
||||||
s->header= state;
|
s->header= state;
|
||||||
s->header_count++;
|
|
||||||
s->frame_size = ret-4;
|
s->frame_size = ret-4;
|
||||||
|
|
||||||
if (s->header_count > 1) {
|
if (s->header_count > 0) {
|
||||||
avctx->sample_rate= sr;
|
avctx->sample_rate= sr;
|
||||||
avctx->channels = channels;
|
avctx->channels = channels;
|
||||||
s1->duration = frame_size;
|
s1->duration = frame_size;
|
||||||
avctx->bit_rate = bit_rate;
|
if (s->no_bitrate || !avctx->bit_rate) {
|
||||||
|
s->no_bitrate = 1;
|
||||||
|
avctx->bit_rate += (bit_rate - avctx->bit_rate) / s->header_count;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
s->header_count++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -211,7 +211,7 @@ static void ff_compute_band_indexes(MPADecodeContext *s, GranuleDef *g)
|
|||||||
else
|
else
|
||||||
g->long_end = 6;
|
g->long_end = 6;
|
||||||
|
|
||||||
g->short_start = 2 + (s->sample_rate_index != 8);
|
g->short_start = 3;
|
||||||
} else {
|
} else {
|
||||||
g->long_end = 0;
|
g->long_end = 0;
|
||||||
g->short_start = 0;
|
g->short_start = 0;
|
||||||
|
@@ -1436,7 +1436,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
|
|||||||
y = (x * f) >> 16;
|
y = (x * f) >> 16;
|
||||||
fr = (x * f) & 0xFFFF;
|
fr = (x * f) & 0xFFFF;
|
||||||
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
|
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
|
||||||
buf[(y + 1) * stride + x] += (color * fr ) >> 16;
|
if(fr) buf[(y + 1) * stride + x] += (color * fr ) >> 16;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (sy > ey) {
|
if (sy > ey) {
|
||||||
@@ -1453,7 +1453,7 @@ static void draw_line(uint8_t *buf, int sx, int sy, int ex, int ey,
|
|||||||
x = (y*f) >> 16;
|
x = (y*f) >> 16;
|
||||||
fr = (y*f) & 0xFFFF;
|
fr = (y*f) & 0xFFFF;
|
||||||
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
|
buf[y * stride + x] += (color * (0x10000 - fr)) >> 16;
|
||||||
buf[y * stride + x + 1] += (color * fr ) >> 16;
|
if(fr) buf[y * stride + x + 1] += (color * fr ) >> 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -591,7 +591,7 @@ av_cold int ff_MPV_encode_init(AVCodecContext *avctx)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->avctx->thread_count > 1)
|
if (s->avctx->slices > 1 || s->avctx->thread_count > 1)
|
||||||
s->rtp_mode = 1;
|
s->rtp_mode = 1;
|
||||||
|
|
||||||
if (!avctx->time_base.den || !avctx->time_base.num) {
|
if (!avctx->time_base.den || !avctx->time_base.num) {
|
||||||
|
@@ -45,6 +45,8 @@ static int png_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
|||||||
int next = END_NOT_FOUND;
|
int next = END_NOT_FOUND;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
s->pict_type = AV_PICTURE_TYPE_NONE;
|
||||||
|
|
||||||
*poutbuf_size = 0;
|
*poutbuf_size = 0;
|
||||||
if (buf_size == 0)
|
if (buf_size == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
|
#define CLIP_AND_BIAS(x) (av_clip((x) + BIAS, CLIP_MIN, CLIP_MAX))
|
||||||
|
|
||||||
#if CONFIG_PRORES_DECODER
|
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
|
||||||
/**
|
/**
|
||||||
* Add bias value, clamp and output pixels of a slice
|
* Add bias value, clamp and output pixels of a slice
|
||||||
*/
|
*/
|
||||||
@@ -53,7 +53,7 @@ static void prores_idct_put_c(uint16_t *out, int linesize, DCTELEM *block, const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONFIG_PRORES_ENCODER
|
#if CONFIG_PRORES_KOSTYA_ENCODER
|
||||||
static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
|
static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
|
||||||
{
|
{
|
||||||
int x, y;
|
int x, y;
|
||||||
@@ -70,7 +70,7 @@ static void prores_fdct_c(const uint16_t *src, int linesize, DCTELEM *block)
|
|||||||
|
|
||||||
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
|
void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
#if CONFIG_PRORES_DECODER
|
#if CONFIG_PRORES_DECODER | CONFIG_PRORES_LGPL_DECODER
|
||||||
dsp->idct_put = prores_idct_put_c;
|
dsp->idct_put = prores_idct_put_c;
|
||||||
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
|
dsp->idct_permutation_type = FF_NO_IDCT_PERM;
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ void ff_proresdsp_init(ProresDSPContext *dsp, AVCodecContext *avctx)
|
|||||||
ff_init_scantable_permutation(dsp->idct_permutation,
|
ff_init_scantable_permutation(dsp->idct_permutation,
|
||||||
dsp->idct_permutation_type);
|
dsp->idct_permutation_type);
|
||||||
#endif
|
#endif
|
||||||
#if CONFIG_PRORES_ENCODER
|
#if CONFIG_PRORES_KOSTYA_ENCODER
|
||||||
dsp->fdct = prores_fdct_c;
|
dsp->fdct = prores_fdct_c;
|
||||||
dsp->dct_permutation_type = FF_NO_IDCT_PERM;
|
dsp->dct_permutation_type = FF_NO_IDCT_PERM;
|
||||||
ff_init_scantable_permutation(dsp->dct_permutation,
|
ff_init_scantable_permutation(dsp->dct_permutation,
|
||||||
|
@@ -79,6 +79,7 @@ typedef struct ThreadContext {
|
|||||||
pthread_cond_t current_job_cond;
|
pthread_cond_t current_job_cond;
|
||||||
pthread_mutex_t current_job_lock;
|
pthread_mutex_t current_job_lock;
|
||||||
int current_job;
|
int current_job;
|
||||||
|
unsigned int current_execute;
|
||||||
int done;
|
int done;
|
||||||
} ThreadContext;
|
} ThreadContext;
|
||||||
|
|
||||||
@@ -203,6 +204,7 @@ static void* attribute_align_arg worker(void *v)
|
|||||||
AVCodecContext *avctx = v;
|
AVCodecContext *avctx = v;
|
||||||
ThreadContext *c = avctx->thread_opaque;
|
ThreadContext *c = avctx->thread_opaque;
|
||||||
int our_job = c->job_count;
|
int our_job = c->job_count;
|
||||||
|
int last_execute = 0;
|
||||||
int thread_count = avctx->thread_count;
|
int thread_count = avctx->thread_count;
|
||||||
int self_id;
|
int self_id;
|
||||||
|
|
||||||
@@ -213,7 +215,9 @@ static void* attribute_align_arg worker(void *v)
|
|||||||
if (c->current_job == thread_count + c->job_count)
|
if (c->current_job == thread_count + c->job_count)
|
||||||
pthread_cond_signal(&c->last_job_cond);
|
pthread_cond_signal(&c->last_job_cond);
|
||||||
|
|
||||||
pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
|
while (last_execute == c->current_execute && !c->done)
|
||||||
|
pthread_cond_wait(&c->current_job_cond, &c->current_job_lock);
|
||||||
|
last_execute = c->current_execute;
|
||||||
our_job = self_id;
|
our_job = self_id;
|
||||||
|
|
||||||
if (c->done) {
|
if (c->done) {
|
||||||
@@ -233,7 +237,8 @@ static void* attribute_align_arg worker(void *v)
|
|||||||
|
|
||||||
static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)
|
static av_always_inline void avcodec_thread_park_workers(ThreadContext *c, int thread_count)
|
||||||
{
|
{
|
||||||
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
|
while (c->current_job != thread_count + c->job_count)
|
||||||
|
pthread_cond_wait(&c->last_job_cond, &c->current_job_lock);
|
||||||
pthread_mutex_unlock(&c->current_job_lock);
|
pthread_mutex_unlock(&c->current_job_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -282,6 +287,7 @@ static int avcodec_thread_execute(AVCodecContext *avctx, action_func* func, void
|
|||||||
c->rets = &dummy_ret;
|
c->rets = &dummy_ret;
|
||||||
c->rets_count = 1;
|
c->rets_count = 1;
|
||||||
}
|
}
|
||||||
|
c->current_execute++;
|
||||||
pthread_cond_broadcast(&c->current_job_cond);
|
pthread_cond_broadcast(&c->current_job_cond);
|
||||||
|
|
||||||
avcodec_thread_park_workers(c, avctx->thread_count);
|
avcodec_thread_park_workers(c, avctx->thread_count);
|
||||||
|
@@ -1363,7 +1363,8 @@ static void qdm2_fft_decode_tones (QDM2Context *q, int duration, GetBitContext *
|
|||||||
if (q->superblocktype_2_3) {
|
if (q->superblocktype_2_3) {
|
||||||
while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
|
while ((n = qdm2_get_vlc(gb, &vlc_tab_fft_tone_offset[local_int_8], 1, 2)) < 2) {
|
||||||
if (get_bits_left(gb)<0) {
|
if (get_bits_left(gb)<0) {
|
||||||
av_log(0, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
|
if(local_int_4 < q->group_size)
|
||||||
|
av_log(0, AV_LOG_ERROR, "overread in qdm2_fft_decode_tones()\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
offset = 1;
|
offset = 1;
|
||||||
|
@@ -41,7 +41,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
int h, w;
|
int h, w;
|
||||||
AVFrame *pic = avctx->coded_frame;
|
AVFrame *pic = avctx->coded_frame;
|
||||||
const uint32_t *src = (const uint32_t *)avpkt->data;
|
const uint32_t *src = (const uint32_t *)avpkt->data;
|
||||||
int aligned_width = FFALIGN(avctx->width, 64);
|
int aligned_width = FFALIGN(avctx->width,
|
||||||
|
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
|
||||||
uint8_t *dst_line;
|
uint8_t *dst_line;
|
||||||
|
|
||||||
if (pic->data[0])
|
if (pic->data[0])
|
||||||
|
@@ -38,7 +38,8 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
const AVFrame *pic, int *got_packet)
|
const AVFrame *pic, int *got_packet)
|
||||||
{
|
{
|
||||||
int i, j, ret;
|
int i, j, ret;
|
||||||
int aligned_width = FFALIGN(avctx->width, 64);
|
int aligned_width = FFALIGN(avctx->width,
|
||||||
|
avctx->codec_id == CODEC_ID_R10K ? 1 : 64);
|
||||||
int pad = (aligned_width - avctx->width) * 4;
|
int pad = (aligned_width - avctx->width) * 4;
|
||||||
uint8_t *src_line;
|
uint8_t *src_line;
|
||||||
uint8_t *dst;
|
uint8_t *dst;
|
||||||
|
@@ -349,7 +349,7 @@ static int rv20_decode_picture_header(RVDecContext *rv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(RV_GET_MINOR_VER(rv->sub_id) >= 2)
|
if(RV_GET_MINOR_VER(rv->sub_id) >= 2)
|
||||||
s->loop_filter = get_bits1(&s->gb);
|
s->loop_filter = get_bits1(&s->gb) && !s->avctx->lowres;
|
||||||
|
|
||||||
if(RV_GET_MINOR_VER(rv->sub_id) <= 1)
|
if(RV_GET_MINOR_VER(rv->sub_id) <= 1)
|
||||||
seq = get_bits(&s->gb, 8) << 7;
|
seq = get_bits(&s->gb, 8) << 7;
|
||||||
|
@@ -36,6 +36,11 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
SgiContext *s = avctx->priv_data;
|
SgiContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
if (avctx->width > 65535 || avctx->height > 65535) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "SGI does not support resolutions above 65535x65535\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&s->picture);
|
avcodec_get_frame_defaults(&s->picture);
|
||||||
avctx->coded_frame = &s->picture;
|
avctx->coded_frame = &s->picture;
|
||||||
|
|
||||||
|
@@ -72,7 +72,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx,
|
|||||||
for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
|
for (i = 2; i < buf_size-2 && j < buf_size+1024-2; i++)
|
||||||
recoded[j++] = buf[i];
|
recoded[j++] = buf[i];
|
||||||
else
|
else
|
||||||
for (i = 14; i < buf_size && j < buf_size+1024-2; i++)
|
for (i = 14; i < buf_size && j < buf_size+1024-3; i++)
|
||||||
{
|
{
|
||||||
recoded[j++] = buf[i];
|
recoded[j++] = buf[i];
|
||||||
if (buf[i] == 0xff)
|
if (buf[i] == 0xff)
|
||||||
|
@@ -501,7 +501,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start,
|
|||||||
break;
|
break;
|
||||||
case TIFF_ROWSPERSTRIP:
|
case TIFF_ROWSPERSTRIP:
|
||||||
if (type == TIFF_LONG && value == UINT_MAX)
|
if (type == TIFF_LONG && value == UINT_MAX)
|
||||||
value = s->avctx->height;
|
value = s->height;
|
||||||
if (value < 1) {
|
if (value < 1) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR,
|
av_log(s->avctx, AV_LOG_ERROR,
|
||||||
"Incorrect value of rows per strip\n");
|
"Incorrect value of rows per strip\n");
|
||||||
|
@@ -512,6 +512,10 @@ hres,vres,i,i%vres (0 < i < 4)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#define APPLY_C_PREDICTOR() \
|
#define APPLY_C_PREDICTOR() \
|
||||||
|
if(index > 1023){\
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
|
||||||
|
return; \
|
||||||
|
}\
|
||||||
predictor_pair = s->c_predictor_table[index]; \
|
predictor_pair = s->c_predictor_table[index]; \
|
||||||
horiz_pred += (predictor_pair >> 1); \
|
horiz_pred += (predictor_pair >> 1); \
|
||||||
if (predictor_pair & 1) { \
|
if (predictor_pair & 1) { \
|
||||||
@@ -529,6 +533,10 @@ hres,vres,i,i%vres (0 < i < 4)
|
|||||||
index++;
|
index++;
|
||||||
|
|
||||||
#define APPLY_C_PREDICTOR_24() \
|
#define APPLY_C_PREDICTOR_24() \
|
||||||
|
if(index > 1023){\
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
|
||||||
|
return; \
|
||||||
|
}\
|
||||||
predictor_pair = s->c_predictor_table[index]; \
|
predictor_pair = s->c_predictor_table[index]; \
|
||||||
horiz_pred += (predictor_pair >> 1); \
|
horiz_pred += (predictor_pair >> 1); \
|
||||||
if (predictor_pair & 1) { \
|
if (predictor_pair & 1) { \
|
||||||
@@ -547,6 +555,10 @@ hres,vres,i,i%vres (0 < i < 4)
|
|||||||
|
|
||||||
|
|
||||||
#define APPLY_Y_PREDICTOR() \
|
#define APPLY_Y_PREDICTOR() \
|
||||||
|
if(index > 1023){\
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
|
||||||
|
return; \
|
||||||
|
}\
|
||||||
predictor_pair = s->y_predictor_table[index]; \
|
predictor_pair = s->y_predictor_table[index]; \
|
||||||
horiz_pred += (predictor_pair >> 1); \
|
horiz_pred += (predictor_pair >> 1); \
|
||||||
if (predictor_pair & 1) { \
|
if (predictor_pair & 1) { \
|
||||||
@@ -564,6 +576,10 @@ hres,vres,i,i%vres (0 < i < 4)
|
|||||||
index++;
|
index++;
|
||||||
|
|
||||||
#define APPLY_Y_PREDICTOR_24() \
|
#define APPLY_Y_PREDICTOR_24() \
|
||||||
|
if(index > 1023){\
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, " index %d went out of bounds\n", index); \
|
||||||
|
return; \
|
||||||
|
}\
|
||||||
predictor_pair = s->y_predictor_table[index]; \
|
predictor_pair = s->y_predictor_table[index]; \
|
||||||
horiz_pred += (predictor_pair >> 1); \
|
horiz_pred += (predictor_pair >> 1); \
|
||||||
if (predictor_pair & 1) { \
|
if (predictor_pair & 1) { \
|
||||||
|
@@ -789,7 +789,7 @@ int attribute_align_arg avcodec_open2(AVCodecContext *avctx, AVCodec *codec, AVD
|
|||||||
|
|
||||||
if (codec->capabilities & CODEC_CAP_EXPERIMENTAL)
|
if (codec->capabilities & CODEC_CAP_EXPERIMENTAL)
|
||||||
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
|
if (avctx->strict_std_compliance > FF_COMPLIANCE_EXPERIMENTAL) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Codec is experimental but experimental codecs are not enabled, see -strict -2\n");
|
av_log(avctx, AV_LOG_ERROR, "Codec is experimental but experimental codecs are not enabled, try -strict -2\n");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto free_and_end;
|
goto free_and_end;
|
||||||
}
|
}
|
||||||
@@ -2194,8 +2194,12 @@ int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes)
|
|||||||
/* calc from frame_bytes, channels, and bits_per_coded_sample */
|
/* calc from frame_bytes, channels, and bits_per_coded_sample */
|
||||||
switch (avctx->codec_id) {
|
switch (avctx->codec_id) {
|
||||||
case CODEC_ID_PCM_DVD:
|
case CODEC_ID_PCM_DVD:
|
||||||
|
if(bps<4)
|
||||||
|
return 0;
|
||||||
return 2 * (frame_bytes / ((bps * 2 / 8) * ch));
|
return 2 * (frame_bytes / ((bps * 2 / 8) * ch));
|
||||||
case CODEC_ID_PCM_BLURAY:
|
case CODEC_ID_PCM_BLURAY:
|
||||||
|
if(bps<4)
|
||||||
|
return 0;
|
||||||
return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
|
return frame_bytes / ((FFALIGN(ch, 2) * bps) / 8);
|
||||||
case CODEC_ID_S302M:
|
case CODEC_ID_S302M:
|
||||||
return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
|
return 2 * (frame_bytes / ((bps + 4) / 4)) / ch;
|
||||||
|
@@ -85,8 +85,6 @@ static int encode_init(AVCodecContext * avctx){
|
|||||||
(avctx->sample_rate * 8);
|
(avctx->sample_rate * 8);
|
||||||
s->block_align = FFMIN(s->block_align, MAX_CODED_SUPERFRAME_SIZE);
|
s->block_align = FFMIN(s->block_align, MAX_CODED_SUPERFRAME_SIZE);
|
||||||
avctx->block_align = s->block_align;
|
avctx->block_align = s->block_align;
|
||||||
avctx->bit_rate = avctx->block_align * 8LL * avctx->sample_rate /
|
|
||||||
s->frame_len;
|
|
||||||
//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", s->block_align, avctx->bit_rate, s->frame_len, avctx->sample_rate);
|
//av_log(NULL, AV_LOG_ERROR, "%d %d %d %d\n", s->block_align, avctx->bit_rate, s->frame_len, avctx->sample_rate);
|
||||||
avctx->frame_size = avctx->delay = s->frame_len;
|
avctx->frame_size = avctx->delay = s->frame_len;
|
||||||
|
|
||||||
|
@@ -70,6 +70,11 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
int prev_y = 0, prev_u = 0, prev_v = 0;
|
int prev_y = 0, prev_u = 0, prev_v = 0;
|
||||||
uint8_t *rbuf;
|
uint8_t *rbuf;
|
||||||
|
|
||||||
|
if(buf_size<=8) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "buf_size %d is too small\n", buf_size);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
rbuf = av_malloc(buf_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if(!rbuf){
|
if(!rbuf){
|
||||||
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
|
av_log(avctx, AV_LOG_ERROR, "Cannot allocate temporary buffer\n");
|
||||||
|
@@ -517,6 +517,10 @@ static int xan_decode_frame(AVCodecContext *avctx,
|
|||||||
int i;
|
int i;
|
||||||
tag = bytestream_get_le32(&buf);
|
tag = bytestream_get_le32(&buf);
|
||||||
size = bytestream_get_be32(&buf);
|
size = bytestream_get_be32(&buf);
|
||||||
|
if(size < 0) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid tag size %d\n", size);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
size = FFMIN(size, buf_end - buf);
|
size = FFMIN(size, buf_end - buf);
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
case PALT_TAG:
|
case PALT_TAG:
|
||||||
|
@@ -89,6 +89,11 @@ static av_cold int yop_decode_init(AVCodecContext *avctx)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!avctx->extradata) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "extradata missing\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
avctx->pix_fmt = PIX_FMT_PAL8;
|
avctx->pix_fmt = PIX_FMT_PAL8;
|
||||||
|
|
||||||
avcodec_get_frame_defaults(&s->frame);
|
avcodec_get_frame_defaults(&s->frame);
|
||||||
@@ -199,6 +204,11 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
if (s->frame.data[0])
|
if (s->frame.data[0])
|
||||||
avctx->release_buffer(avctx, &s->frame);
|
avctx->release_buffer(avctx, &s->frame);
|
||||||
|
|
||||||
|
if (avpkt->size < 4 + 3*s->num_pal_colors) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "packet of size %d too small\n", avpkt->size);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
ret = avctx->get_buffer(avctx, &s->frame);
|
ret = avctx->get_buffer(avctx, &s->frame);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n");
|
||||||
@@ -214,6 +224,10 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size,
|
|||||||
s->low_nibble = NULL;
|
s->low_nibble = NULL;
|
||||||
|
|
||||||
is_odd_frame = avpkt->data[0];
|
is_odd_frame = avpkt->data[0];
|
||||||
|
if(is_odd_frame>1){
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "frame is too odd %d\n", is_odd_frame);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
firstcolor = s->first_color[is_odd_frame];
|
firstcolor = s->first_color[is_odd_frame];
|
||||||
palette = (uint32_t *)s->frame.data[1];
|
palette = (uint32_t *)s->frame.data[1];
|
||||||
|
|
||||||
|
@@ -37,6 +37,7 @@ typedef struct {
|
|||||||
double ratio;
|
double ratio;
|
||||||
struct SwrContext *swr;
|
struct SwrContext *swr;
|
||||||
int64_t next_pts;
|
int64_t next_pts;
|
||||||
|
int req_fullfilled;
|
||||||
} AResampleContext;
|
} AResampleContext;
|
||||||
|
|
||||||
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
|
static av_cold int init(AVFilterContext *ctx, const char *args, void *opaque)
|
||||||
@@ -173,31 +174,12 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
|
|||||||
AVFilterLink *const outlink = inlink->dst->outputs[0];
|
AVFilterLink *const outlink = inlink->dst->outputs[0];
|
||||||
AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
|
AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
|
||||||
|
|
||||||
n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
|
|
||||||
(void *)insamplesref->extended_data, n_in);
|
|
||||||
if (n_out <= 0) {
|
|
||||||
avfilter_unref_buffer(outsamplesref);
|
|
||||||
avfilter_unref_buffer(insamplesref);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
|
avfilter_copy_buffer_ref_props(outsamplesref, insamplesref);
|
||||||
|
outsamplesref->format = outlink->format;
|
||||||
|
outsamplesref->audio->channel_layout = outlink->channel_layout;
|
||||||
|
outsamplesref->audio->sample_rate = outlink->sample_rate;
|
||||||
|
|
||||||
outsamplesref->audio->sample_rate = outlink->sample_rate;
|
|
||||||
outsamplesref->audio->nb_samples = n_out;
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
if(insamplesref->pts != AV_NOPTS_VALUE) {
|
|
||||||
aresample->next_pts =
|
|
||||||
outsamplesref->pts = av_rescale_q(insamplesref->pts, inlink->time_base, outlink->time_base)
|
|
||||||
- swr_get_delay(aresample->swr, outlink->time_base.den);
|
|
||||||
av_assert0(outlink->time_base.num == 1);
|
|
||||||
} else{
|
|
||||||
outsamplesref->pts = AV_NOPTS_VALUE; //aresample->next_pts;
|
|
||||||
}
|
|
||||||
if(aresample->next_pts != AV_NOPTS_VALUE)
|
|
||||||
aresample->next_pts += av_rescale_q(n_out, (AVRational){1 ,outlink->sample_rate}, outlink->time_base);
|
|
||||||
#else
|
|
||||||
if(insamplesref->pts != AV_NOPTS_VALUE) {
|
if(insamplesref->pts != AV_NOPTS_VALUE) {
|
||||||
int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den);
|
int64_t inpts = av_rescale(insamplesref->pts, inlink->time_base.num * (int64_t)outlink->sample_rate * inlink->sample_rate, inlink->time_base.den);
|
||||||
int64_t outpts= swr_next_pts(aresample->swr, inpts);
|
int64_t outpts= swr_next_pts(aresample->swr, inpts);
|
||||||
@@ -206,8 +188,20 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
|
|||||||
} else {
|
} else {
|
||||||
outsamplesref->pts = AV_NOPTS_VALUE;
|
outsamplesref->pts = AV_NOPTS_VALUE;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
n_out = swr_convert(aresample->swr, outsamplesref->extended_data, n_out,
|
||||||
|
(void *)insamplesref->extended_data, n_in);
|
||||||
|
if (n_out <= 0) {
|
||||||
|
avfilter_unref_buffer(outsamplesref);
|
||||||
|
avfilter_unref_buffer(insamplesref);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
outsamplesref->audio->sample_rate = outlink->sample_rate;
|
||||||
|
outsamplesref->audio->nb_samples = n_out;
|
||||||
|
|
||||||
ff_filter_samples(outlink, outsamplesref);
|
ff_filter_samples(outlink, outsamplesref);
|
||||||
|
aresample->req_fullfilled= 1;
|
||||||
avfilter_unref_buffer(insamplesref);
|
avfilter_unref_buffer(insamplesref);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +210,12 @@ static int request_frame(AVFilterLink *outlink)
|
|||||||
AVFilterContext *ctx = outlink->src;
|
AVFilterContext *ctx = outlink->src;
|
||||||
AResampleContext *aresample = ctx->priv;
|
AResampleContext *aresample = ctx->priv;
|
||||||
AVFilterLink *const inlink = outlink->src->inputs[0];
|
AVFilterLink *const inlink = outlink->src->inputs[0];
|
||||||
int ret = avfilter_request_frame(ctx->inputs[0]);
|
int ret;
|
||||||
|
|
||||||
|
aresample->req_fullfilled = 0;
|
||||||
|
do{
|
||||||
|
ret = avfilter_request_frame(ctx->inputs[0]);
|
||||||
|
}while(!aresample->req_fullfilled && ret>=0);
|
||||||
|
|
||||||
if (ret == AVERROR_EOF) {
|
if (ret == AVERROR_EOF) {
|
||||||
AVFilterBufferRef *outsamplesref;
|
AVFilterBufferRef *outsamplesref;
|
||||||
|
@@ -204,7 +204,7 @@ void ff_filter_samples(AVFilterLink *link, AVFilterBufferRef *samplesref)
|
|||||||
link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
|
link->cur_buf->audio->sample_rate = samplesref->audio->sample_rate;
|
||||||
|
|
||||||
/* Copy actual data into new samples buffer */
|
/* Copy actual data into new samples buffer */
|
||||||
for (i = 0; samplesref->data[i] && i < 8; i++)
|
for (i = 0; i < 8 && samplesref->data[i]; i++)
|
||||||
memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]);
|
memcpy(link->cur_buf->data[i], samplesref->data[i], samplesref->linesize[0]);
|
||||||
for (i = 0; i < planes; i++)
|
for (i = 0; i < planes; i++)
|
||||||
memcpy(link->cur_buf->extended_data[i], samplesref->extended_data[i], samplesref->linesize[0]);
|
memcpy(link->cur_buf->extended_data[i], samplesref->extended_data[i], samplesref->linesize[0]);
|
||||||
|
@@ -59,10 +59,13 @@ int avfilter_fill_frame_from_audio_buffer_ref(AVFrame *frame,
|
|||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
memcpy(frame->data, samplesref->data, sizeof(frame->data));
|
memcpy(frame->data, samplesref->data, sizeof(frame->data));
|
||||||
frame->pkt_pos = samplesref->pos;
|
memcpy(frame->linesize, samplesref->linesize, sizeof(frame->linesize));
|
||||||
frame->format = samplesref->format;
|
av_frame_set_pkt_pos(frame, samplesref->pos);
|
||||||
frame->nb_samples = samplesref->audio->nb_samples;
|
frame->format = samplesref->format;
|
||||||
frame->pts = samplesref->pts;
|
frame->nb_samples = samplesref->audio->nb_samples;
|
||||||
|
frame->pts = samplesref->pts;
|
||||||
|
frame->sample_rate = samplesref->audio->sample_rate;
|
||||||
|
frame->channel_layout = samplesref->audio->channel_layout;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -75,7 +78,7 @@ int avfilter_fill_frame_from_video_buffer_ref(AVFrame *frame,
|
|||||||
|
|
||||||
memcpy(frame->data, picref->data, sizeof(frame->data));
|
memcpy(frame->data, picref->data, sizeof(frame->data));
|
||||||
memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
|
memcpy(frame->linesize, picref->linesize, sizeof(frame->linesize));
|
||||||
frame->pkt_pos = picref->pos;
|
av_frame_set_pkt_pos(frame, picref->pos);
|
||||||
frame->interlaced_frame = picref->video->interlaced;
|
frame->interlaced_frame = picref->video->interlaced;
|
||||||
frame->top_field_first = picref->video->top_field_first;
|
frame->top_field_first = picref->video->top_field_first;
|
||||||
frame->key_frame = picref->video->key_frame;
|
frame->key_frame = picref->video->key_frame;
|
||||||
|
@@ -166,7 +166,7 @@ void avfilter_unref_bufferp(AVFilterBufferRef **ref)
|
|||||||
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
|
int avfilter_copy_frame_props(AVFilterBufferRef *dst, const AVFrame *src)
|
||||||
{
|
{
|
||||||
dst->pts = src->pts;
|
dst->pts = src->pts;
|
||||||
dst->pos = src->pkt_pos;
|
dst->pos = av_frame_get_pkt_pos(src);
|
||||||
dst->format = src->format;
|
dst->format = src->format;
|
||||||
|
|
||||||
switch (dst->type) {
|
switch (dst->type) {
|
||||||
|
@@ -200,6 +200,11 @@ static int fourxm_read_header(AVFormatContext *s)
|
|||||||
ret = AVERROR_INVALIDDATA;
|
ret = AVERROR_INVALIDDATA;
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
if(!fourxm->tracks[current_track].adpcm && fourxm->tracks[current_track].bits<8){
|
||||||
|
av_log(s, AV_LOG_ERROR, "bits unspecified for non ADPCM\n");
|
||||||
|
ret = AVERROR_INVALIDDATA;
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
i += 8 + size;
|
i += 8 + size;
|
||||||
|
|
||||||
/* allocate a new AVStream */
|
/* allocate a new AVStream */
|
||||||
|
@@ -163,7 +163,7 @@ OBJS-$(CONFIG_MOV_DEMUXER) += mov.o isom.o mov_chan.o
|
|||||||
OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o \
|
OBJS-$(CONFIG_MOV_MUXER) += movenc.o isom.o avc.o \
|
||||||
movenchint.o rtpenc_chain.o \
|
movenchint.o rtpenc_chain.o \
|
||||||
mov_chan.o
|
mov_chan.o
|
||||||
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o
|
OBJS-$(CONFIG_MP2_MUXER) += mp3enc.o rawenc.o id3v2enc.o
|
||||||
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o
|
OBJS-$(CONFIG_MP3_DEMUXER) += mp3dec.o
|
||||||
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
|
OBJS-$(CONFIG_MP3_MUXER) += mp3enc.o rawenc.o id3v2enc.o
|
||||||
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o
|
OBJS-$(CONFIG_MPC_DEMUXER) += mpc.o apetag.o
|
||||||
|
@@ -37,6 +37,8 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
|
|||||||
end = buf + p->buf_size;
|
end = buf + p->buf_size;
|
||||||
|
|
||||||
for(; buf < end; buf++) {
|
for(; buf < end; buf++) {
|
||||||
|
if(buf > p->buf && (buf[0] != 0x0B || buf[1] != 0x77) )
|
||||||
|
continue;
|
||||||
buf2 = buf;
|
buf2 = buf;
|
||||||
|
|
||||||
for(frames = 0; buf2 < end; frames++) {
|
for(frames = 0; buf2 < end; frames++) {
|
||||||
|
@@ -278,6 +278,9 @@ static int ape_read_header(AVFormatContext * s)
|
|||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
|
for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
|
||||||
ape->seektable[i] = avio_rl32(pb);
|
ape->seektable[i] = avio_rl32(pb);
|
||||||
|
}else{
|
||||||
|
av_log(s, AV_LOG_ERROR, "Missing seektable\n");
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ape->frames[0].pos = ape->firstframe;
|
ape->frames[0].pos = ape->firstframe;
|
||||||
|
@@ -578,6 +578,7 @@ static int avi_read_header(AVFormatContext *s)
|
|||||||
avio_skip(pb, size);
|
avio_skip(pb, size);
|
||||||
} else {
|
} else {
|
||||||
uint64_t cur_pos = avio_tell(pb);
|
uint64_t cur_pos = avio_tell(pb);
|
||||||
|
unsigned esize;
|
||||||
if (cur_pos < list_end)
|
if (cur_pos < list_end)
|
||||||
size = FFMIN(size, list_end - cur_pos);
|
size = FFMIN(size, list_end - cur_pos);
|
||||||
st = s->streams[stream_index];
|
st = s->streams[stream_index];
|
||||||
@@ -591,7 +592,7 @@ static int avi_read_header(AVFormatContext *s)
|
|||||||
avio_skip(pb, size);
|
avio_skip(pb, size);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tag1 = ff_get_bmp_header(pb, st);
|
tag1 = ff_get_bmp_header(pb, st, &esize);
|
||||||
|
|
||||||
if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) {
|
if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) {
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
||||||
@@ -601,7 +602,8 @@ static int avi_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(size > 10*4 && size<(1<<30) && size < avi->fsize){
|
if(size > 10*4 && size<(1<<30) && size < avi->fsize){
|
||||||
st->codec->extradata_size= size - 10*4;
|
if(esize == size-1 && (esize&1)) st->codec->extradata_size= esize - 10*4;
|
||||||
|
else st->codec->extradata_size= size - 10*4;
|
||||||
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!st->codec->extradata) {
|
if (!st->codec->extradata) {
|
||||||
st->codec->extradata_size= 0;
|
st->codec->extradata_size= 0;
|
||||||
@@ -1260,6 +1262,11 @@ static int avi_read_idx1(AVFormatContext *s, int size)
|
|||||||
avi->stream_index = -1;
|
avi->stream_index = -1;
|
||||||
avio_seek(pb, idx1_pos, SEEK_SET);
|
avio_seek(pb, idx1_pos, SEEK_SET);
|
||||||
|
|
||||||
|
if (s->nb_streams == 1 && s->streams[0]->codec->codec_tag == AV_RL32("MMES")){
|
||||||
|
first_packet_pos = 0;
|
||||||
|
data_offset = avi->movi_list;
|
||||||
|
}
|
||||||
|
|
||||||
/* Read the entries and sort them in each stream component. */
|
/* Read the entries and sort them in each stream component. */
|
||||||
for(i = 0; i < nb_index_entries; i++) {
|
for(i = 0; i < nb_index_entries; i++) {
|
||||||
if(url_feof(pb))
|
if(url_feof(pb))
|
||||||
|
@@ -255,9 +255,12 @@ static int avi_write_header(AVFormatContext *s)
|
|||||||
|
|
||||||
ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
|
ff_parse_specific_params(stream, &au_byterate, &au_ssize, &au_scale);
|
||||||
|
|
||||||
|
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
|
||||||
|
if(stream->codec_id == CODEC_ID_XSUB)
|
||||||
|
au_scale = au_byterate = 0;
|
||||||
|
|
||||||
avio_wl32(pb, au_scale); /* scale */
|
avio_wl32(pb, au_scale); /* scale */
|
||||||
avio_wl32(pb, au_byterate); /* rate */
|
avio_wl32(pb, au_byterate); /* rate */
|
||||||
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
|
|
||||||
|
|
||||||
avio_wl32(pb, 0); /* start */
|
avio_wl32(pb, 0); /* start */
|
||||||
avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
|
avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
|
||||||
@@ -521,7 +524,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
int size= pkt->size;
|
int size= pkt->size;
|
||||||
|
|
||||||
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %d\n", pkt->dts, avist->packet_count, stream_index);
|
// av_log(s, AV_LOG_DEBUG, "%"PRId64" %d %d\n", pkt->dts, avist->packet_count, stream_index);
|
||||||
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count){
|
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != CODEC_ID_XSUB){
|
||||||
AVPacket empty_packet;
|
AVPacket empty_packet;
|
||||||
|
|
||||||
if(pkt->dts - avist->packet_count > 60000){
|
if(pkt->dts - avist->packet_count > 60000){
|
||||||
|
@@ -210,7 +210,9 @@ int ffurl_alloc(URLContext **puc, const char *filename, int flags,
|
|||||||
"Missing call to av_register_all()?\n");
|
"Missing call to av_register_all()?\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filename[proto_len] != ':' && filename[proto_len] != ',' || is_dos_path(filename))
|
if (filename[proto_len] != ':' &&
|
||||||
|
(filename[proto_len] != ',' || !strchr(filename + proto_len + 1, ':')) ||
|
||||||
|
is_dos_path(filename))
|
||||||
strcpy(proto_str, "file");
|
strcpy(proto_str, "file");
|
||||||
else
|
else
|
||||||
av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str)));
|
av_strlcpy(proto_str, filename, FFMIN(proto_len+1, sizeof(proto_str)));
|
||||||
|
@@ -55,7 +55,7 @@ static int avisynth_read_header(AVFormatContext *s)
|
|||||||
res = AVIFileOpen(&avs->file, s->filename, OF_READ|OF_SHARE_DENY_WRITE, NULL);
|
res = AVIFileOpen(&avs->file, s->filename, OF_READ|OF_SHARE_DENY_WRITE, NULL);
|
||||||
if (res != S_OK)
|
if (res != S_OK)
|
||||||
{
|
{
|
||||||
av_log(s, AV_LOG_ERROR, "AVIFileOpen failed with error %ld", res);
|
av_log(s, AV_LOG_ERROR, "AVIFileOpen failed with error %ld\n", res);
|
||||||
AVIFileExit();
|
AVIFileExit();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ static int avisynth_read_header(AVFormatContext *s)
|
|||||||
res = AVIFileInfo(avs->file, &info, sizeof(info));
|
res = AVIFileInfo(avs->file, &info, sizeof(info));
|
||||||
if (res != S_OK)
|
if (res != S_OK)
|
||||||
{
|
{
|
||||||
av_log(s, AV_LOG_ERROR, "AVIFileInfo failed with error %ld", res);
|
av_log(s, AV_LOG_ERROR, "AVIFileInfo failed with error %ld\n", res);
|
||||||
AVIFileExit();
|
AVIFileExit();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@@ -273,9 +273,6 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
|
|||||||
avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
|
avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
|
||||||
c->sys->time_base.den);
|
c->sys->time_base.den);
|
||||||
avctx->time_base= c->sys->time_base;
|
avctx->time_base= c->sys->time_base;
|
||||||
if (!avctx->width)
|
|
||||||
avcodec_set_dimensions(avctx, c->sys->width, c->sys->height);
|
|
||||||
avctx->pix_fmt = c->sys->pix_fmt;
|
|
||||||
|
|
||||||
/* finding out SAR is a little bit messy */
|
/* finding out SAR is a little bit messy */
|
||||||
vsc_pack = dv_extract_pack(frame, dv_video_control);
|
vsc_pack = dv_extract_pack(frame, dv_video_control);
|
||||||
|
@@ -529,8 +529,9 @@ static int ipmovie_probe(AVProbeData *p)
|
|||||||
uint8_t *b = p->buf;
|
uint8_t *b = p->buf;
|
||||||
uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
|
uint8_t *b_end = p->buf + p->buf_size - sizeof(signature);
|
||||||
do {
|
do {
|
||||||
if (memcmp(b++, signature, sizeof(signature)) == 0)
|
if (b[0] == signature[0] && memcmp(b, signature, sizeof(signature)) == 0)
|
||||||
return AVPROBE_SCORE_MAX;
|
return AVPROBE_SCORE_MAX;
|
||||||
|
b++;
|
||||||
} while (b < b_end);
|
} while (b < b_end);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -63,10 +63,13 @@ static int jacosub_probe(AVProbeData *p)
|
|||||||
ptr += 3; /* skip UTF-8 BOM */
|
ptr += 3; /* skip UTF-8 BOM */
|
||||||
|
|
||||||
while (ptr < ptr_end) {
|
while (ptr < ptr_end) {
|
||||||
if (timed_line(ptr))
|
|
||||||
return AVPROBE_SCORE_MAX / 2;
|
|
||||||
while (jss_whitespace(*ptr))
|
while (jss_whitespace(*ptr))
|
||||||
ptr++;
|
ptr++;
|
||||||
|
if (*ptr != '#' && *ptr != '\n') {
|
||||||
|
if (timed_line(ptr))
|
||||||
|
return AVPROBE_SCORE_MAX/2 + 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
ptr += strcspn(ptr, "\n") + 1;
|
ptr += strcspn(ptr, "\n") + 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -55,7 +55,6 @@ static int loas_probe(AVProbeData *p)
|
|||||||
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
|
if (first_frames>=3) return AVPROBE_SCORE_MAX/2+1;
|
||||||
else if(max_frames>100)return AVPROBE_SCORE_MAX/2;
|
else if(max_frames>100)return AVPROBE_SCORE_MAX/2;
|
||||||
else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
|
else if(max_frames>=3) return AVPROBE_SCORE_MAX/4;
|
||||||
else if(max_frames>=1) return 1;
|
|
||||||
else return 0;
|
else return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -21,6 +21,9 @@
|
|||||||
|
|
||||||
#include "matroska.h"
|
#include "matroska.h"
|
||||||
|
|
||||||
|
/* If you add a tag here that is not in ff_codec_bmp_tags[]
|
||||||
|
or ff_codec_wav_tags[], add it also to additional_audio_tags[]
|
||||||
|
or additional_video_tags[] in matroskaenc.c */
|
||||||
const CodecTags ff_mkv_codec_tags[]={
|
const CodecTags ff_mkv_codec_tags[]={
|
||||||
{"A_AAC" , CODEC_ID_AAC},
|
{"A_AAC" , CODEC_ID_AAC},
|
||||||
{"A_AC3" , CODEC_ID_AC3},
|
{"A_AC3" , CODEC_ID_AC3},
|
||||||
|
@@ -1304,6 +1304,32 @@ static int mkv_query_codec(enum CodecID codec_id, int std_compliance)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const AVCodecTag additional_audio_tags[] = {
|
||||||
|
{ CODEC_ID_ALAC, 0XFFFFFFFF },
|
||||||
|
{ CODEC_ID_EAC3, 0XFFFFFFFF },
|
||||||
|
{ CODEC_ID_MLP, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_PCM_S16BE, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_PCM_S24BE, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_PCM_S32BE, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_QDM2, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RA_144, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RA_288, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_COOK, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_TRUEHD, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_TTA, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_WAVPACK, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_NONE, 0xFFFFFFFF }
|
||||||
|
};
|
||||||
|
|
||||||
|
const AVCodecTag additional_video_tags[] = {
|
||||||
|
{ CODEC_ID_PRORES, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RV10, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RV20, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RV30, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_RV40, 0xFFFFFFFF },
|
||||||
|
{ CODEC_ID_NONE, 0xFFFFFFFF }
|
||||||
|
};
|
||||||
|
|
||||||
#if CONFIG_MATROSKA_MUXER
|
#if CONFIG_MATROSKA_MUXER
|
||||||
AVOutputFormat ff_matroska_muxer = {
|
AVOutputFormat ff_matroska_muxer = {
|
||||||
.name = "matroska",
|
.name = "matroska",
|
||||||
@@ -1326,6 +1352,10 @@ AVOutputFormat ff_matroska_muxer = {
|
|||||||
.write_trailer = mkv_write_trailer,
|
.write_trailer = mkv_write_trailer,
|
||||||
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
|
.flags = AVFMT_GLOBALHEADER | AVFMT_VARIABLE_FPS |
|
||||||
AVFMT_TS_NONSTRICT,
|
AVFMT_TS_NONSTRICT,
|
||||||
|
.codec_tag = (const AVCodecTag* const []){
|
||||||
|
ff_codec_bmp_tags, ff_codec_wav_tags,
|
||||||
|
additional_audio_tags, additional_video_tags, 0
|
||||||
|
},
|
||||||
.subtitle_codec = CODEC_ID_SSA,
|
.subtitle_codec = CODEC_ID_SSA,
|
||||||
.query_codec = mkv_query_codec,
|
.query_codec = mkv_query_codec,
|
||||||
};
|
};
|
||||||
@@ -1365,5 +1395,8 @@ AVOutputFormat ff_matroska_audio_muxer = {
|
|||||||
.write_packet = mkv_write_packet,
|
.write_packet = mkv_write_packet,
|
||||||
.write_trailer = mkv_write_trailer,
|
.write_trailer = mkv_write_trailer,
|
||||||
.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
|
.flags = AVFMT_GLOBALHEADER | AVFMT_TS_NONSTRICT,
|
||||||
|
.codec_tag = (const AVCodecTag* const []){
|
||||||
|
ff_codec_wav_tags, additional_audio_tags, 0
|
||||||
|
},
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1874,7 +1874,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
|||||||
sc->empty_duration = av_rescale(sc->empty_duration, sc->time_scale, mov->time_scale);
|
sc->empty_duration = av_rescale(sc->empty_duration, sc->time_scale, mov->time_scale);
|
||||||
sc->time_offset = sc->start_time - sc->empty_duration;
|
sc->time_offset = sc->start_time - sc->empty_duration;
|
||||||
current_dts = -sc->time_offset;
|
current_dts = -sc->time_offset;
|
||||||
if (sc->ctts_data && sc->stts_data &&
|
if (sc->ctts_count>0 && sc->stts_count>0 &&
|
||||||
sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) {
|
sc->ctts_data[0].duration / FFMAX(sc->stts_data[0].duration, 1) > 16) {
|
||||||
/* more than 16 frames delay, dts are likely wrong
|
/* more than 16 frames delay, dts are likely wrong
|
||||||
this happens with files created by iMovie */
|
this happens with files created by iMovie */
|
||||||
|
@@ -1078,13 +1078,17 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
|
|||||||
mov_write_avcc_tag(pb, track);
|
mov_write_avcc_tag(pb, track);
|
||||||
if(track->mode == MODE_IPOD)
|
if(track->mode == MODE_IPOD)
|
||||||
mov_write_uuid_tag_ipod(pb);
|
mov_write_uuid_tag_ipod(pb);
|
||||||
} else if (track->enc->field_order != AV_FIELD_UNKNOWN)
|
} else if (track->enc->codec_id == CODEC_ID_VC1 && track->vos_len > 0)
|
||||||
mov_write_fiel_tag(pb, track);
|
|
||||||
else if (track->enc->codec_id == CODEC_ID_VC1 && track->vos_len > 0)
|
|
||||||
mov_write_dvc1_tag(pb, track);
|
mov_write_dvc1_tag(pb, track);
|
||||||
else if (track->vos_len > 0)
|
else if (track->vos_len > 0)
|
||||||
mov_write_glbl_tag(pb, track);
|
mov_write_glbl_tag(pb, track);
|
||||||
|
|
||||||
|
if (track->enc->codec_id != CODEC_ID_H264 &&
|
||||||
|
track->enc->codec_id != CODEC_ID_MPEG4 &&
|
||||||
|
track->enc->codec_id != CODEC_ID_DNXHD)
|
||||||
|
if (track->enc->field_order != AV_FIELD_UNKNOWN)
|
||||||
|
mov_write_fiel_tag(pb, track);
|
||||||
|
|
||||||
if (track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num &&
|
if (track->enc->sample_aspect_ratio.den && track->enc->sample_aspect_ratio.num &&
|
||||||
track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) {
|
track->enc->sample_aspect_ratio.den != track->enc->sample_aspect_ratio.num) {
|
||||||
mov_write_pasp_tag(pb, track);
|
mov_write_pasp_tag(pb, track);
|
||||||
|
@@ -88,6 +88,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
|
|||||||
const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
|
const int64_t xing_offtbl[2][2] = {{32, 17}, {17,9}};
|
||||||
MPADecodeHeader c;
|
MPADecodeHeader c;
|
||||||
int vbrtag_size = 0;
|
int vbrtag_size = 0;
|
||||||
|
int is_cbr;
|
||||||
|
|
||||||
v = avio_rb32(s->pb);
|
v = avio_rb32(s->pb);
|
||||||
if(ff_mpa_check_header(v) < 0)
|
if(ff_mpa_check_header(v) < 0)
|
||||||
@@ -101,7 +102,8 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
|
|||||||
/* Check for Xing / Info tag */
|
/* Check for Xing / Info tag */
|
||||||
avio_skip(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
|
avio_skip(s->pb, xing_offtbl[c.lsf == 1][c.nb_channels == 1]);
|
||||||
v = avio_rb32(s->pb);
|
v = avio_rb32(s->pb);
|
||||||
if(v == MKBETAG('X', 'i', 'n', 'g') || v == MKBETAG('I', 'n', 'f', 'o')) {
|
is_cbr = v == MKBETAG('I', 'n', 'f', 'o');
|
||||||
|
if (v == MKBETAG('X', 'i', 'n', 'g') || is_cbr) {
|
||||||
v = avio_rb32(s->pb);
|
v = avio_rb32(s->pb);
|
||||||
if(v & 0x1)
|
if(v & 0x1)
|
||||||
frames = avio_rb32(s->pb);
|
frames = avio_rb32(s->pb);
|
||||||
@@ -132,7 +134,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
|
|||||||
if(frames)
|
if(frames)
|
||||||
st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
|
st->duration = av_rescale_q(frames, (AVRational){spf, c.sample_rate},
|
||||||
st->time_base);
|
st->time_base);
|
||||||
if(size && frames)
|
if (size && frames && !is_cbr)
|
||||||
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
|
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -336,6 +336,13 @@ static int ogg_read_page(AVFormatContext *s, int *str)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief find the next Ogg packet
|
||||||
|
* @param *str is set to the stream for the packet or -1 if there is
|
||||||
|
* no matching stream, in that case assume all other return
|
||||||
|
* values to be uninitialized.
|
||||||
|
* @return negative value on error or EOF.
|
||||||
|
*/
|
||||||
static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
|
static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
|
||||||
int64_t *fpos)
|
int64_t *fpos)
|
||||||
{
|
{
|
||||||
@@ -346,6 +353,8 @@ static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
|
|||||||
int segp = 0, psize = 0;
|
int segp = 0, psize = 0;
|
||||||
|
|
||||||
av_dlog(s, "ogg_packet: curidx=%i\n", ogg->curidx);
|
av_dlog(s, "ogg_packet: curidx=%i\n", ogg->curidx);
|
||||||
|
if (str)
|
||||||
|
*str = -1;
|
||||||
|
|
||||||
do{
|
do{
|
||||||
idx = ogg->curidx;
|
idx = ogg->curidx;
|
||||||
@@ -524,15 +533,18 @@ static int ogg_get_length(AVFormatContext *s)
|
|||||||
ogg_save (s);
|
ogg_save (s);
|
||||||
avio_seek (s->pb, s->data_offset, SEEK_SET);
|
avio_seek (s->pb, s->data_offset, SEEK_SET);
|
||||||
ogg_reset(s);
|
ogg_reset(s);
|
||||||
while (!ogg_packet(s, &i, NULL, NULL, NULL)) {
|
while (streams_left > 0 && !ogg_packet(s, &i, NULL, NULL, NULL)) {
|
||||||
int64_t pts = ogg_calc_pts(s, i, NULL);
|
int64_t pts;
|
||||||
|
if (i < 0) continue;
|
||||||
|
pts = ogg_calc_pts(s, i, NULL);
|
||||||
if (pts != AV_NOPTS_VALUE && s->streams[i]->start_time == AV_NOPTS_VALUE && !ogg->streams[i].got_start){
|
if (pts != AV_NOPTS_VALUE && s->streams[i]->start_time == AV_NOPTS_VALUE && !ogg->streams[i].got_start){
|
||||||
s->streams[i]->duration -= pts;
|
s->streams[i]->duration -= pts;
|
||||||
ogg->streams[i].got_start= 1;
|
ogg->streams[i].got_start= 1;
|
||||||
streams_left--;
|
streams_left--;
|
||||||
|
}else if(s->streams[i]->start_time != AV_NOPTS_VALUE && !ogg->streams[i].got_start){
|
||||||
|
ogg->streams[i].got_start= 1;
|
||||||
|
streams_left--;
|
||||||
}
|
}
|
||||||
if(streams_left<=0)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
ogg_restore (s, 0);
|
ogg_restore (s, 0);
|
||||||
|
|
||||||
@@ -607,7 +619,7 @@ static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
{
|
{
|
||||||
struct ogg *ogg;
|
struct ogg *ogg;
|
||||||
struct ogg_stream *os;
|
struct ogg_stream *os;
|
||||||
int idx = -1, ret;
|
int idx, ret;
|
||||||
int pstart, psize;
|
int pstart, psize;
|
||||||
int64_t fpos, pts, dts;
|
int64_t fpos, pts, dts;
|
||||||
|
|
||||||
@@ -666,7 +678,7 @@ static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
|
|||||||
AVIOContext *bc = s->pb;
|
AVIOContext *bc = s->pb;
|
||||||
int64_t pts = AV_NOPTS_VALUE;
|
int64_t pts = AV_NOPTS_VALUE;
|
||||||
int64_t keypos = -1;
|
int64_t keypos = -1;
|
||||||
int i = -1;
|
int i;
|
||||||
int pstart, psize;
|
int pstart, psize;
|
||||||
avio_seek(bc, *pos_arg, SEEK_SET);
|
avio_seek(bc, *pos_arg, SEEK_SET);
|
||||||
ogg_reset(s);
|
ogg_reset(s);
|
||||||
|
@@ -203,12 +203,12 @@ vorbis_header (AVFormatContext * s, int idx)
|
|||||||
int pkt_type = os->buf[os->pstart];
|
int pkt_type = os->buf[os->pstart];
|
||||||
|
|
||||||
if (!(pkt_type & 1))
|
if (!(pkt_type & 1))
|
||||||
return 0;
|
return os->private ? 0 : -1;
|
||||||
|
|
||||||
if (!os->private) {
|
if (!os->private) {
|
||||||
os->private = av_mallocz(sizeof(struct oggvorbis_private));
|
os->private = av_mallocz(sizeof(struct oggvorbis_private));
|
||||||
if (!os->private)
|
if (!os->private)
|
||||||
return 0;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (os->psize < 1 || pkt_type > 5)
|
if (os->psize < 1 || pkt_type > 5)
|
||||||
|
@@ -652,10 +652,11 @@ enum CodecID ff_wav_codec_get_id(unsigned int tag, int bps)
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_get_bmp_header(AVIOContext *pb, AVStream *st)
|
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize)
|
||||||
{
|
{
|
||||||
int tag1;
|
int tag1;
|
||||||
avio_rl32(pb); /* size */
|
if(esize) *esize = avio_rl32(pb);
|
||||||
|
else avio_rl32(pb);
|
||||||
st->codec->width = avio_rl32(pb);
|
st->codec->width = avio_rl32(pb);
|
||||||
st->codec->height = (int32_t)avio_rl32(pb);
|
st->codec->height = (int32_t)avio_rl32(pb);
|
||||||
avio_rl16(pb); /* planes */
|
avio_rl16(pb); /* planes */
|
||||||
@@ -734,8 +735,13 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
|
|||||||
chunk_code = avio_rl32(pb);
|
chunk_code = avio_rl32(pb);
|
||||||
chunk_size = avio_rl32(pb);
|
chunk_size = avio_rl32(pb);
|
||||||
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
||||||
av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
|
avio_seek(pb, -9, SEEK_CUR);
|
||||||
return AVERROR_INVALIDDATA;
|
chunk_code = avio_rl32(pb);
|
||||||
|
chunk_size = avio_rl32(pb);
|
||||||
|
if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
chunk_size += (chunk_size & 1);
|
chunk_size += (chunk_size & 1);
|
||||||
|
@@ -44,7 +44,7 @@ void ff_end_tag(AVIOContext *pb, int64_t start);
|
|||||||
* bits_per_encoded_sample fields. Does not read extradata.
|
* bits_per_encoded_sample fields. Does not read extradata.
|
||||||
* @return codec tag
|
* @return codec tag
|
||||||
*/
|
*/
|
||||||
int ff_get_bmp_header(AVIOContext *pb, AVStream *st);
|
int ff_get_bmp_header(AVIOContext *pb, AVStream *st, unsigned *esize);
|
||||||
|
|
||||||
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
|
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc, const AVCodecTag *tags, int for_asf);
|
||||||
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
|
int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc);
|
||||||
|
@@ -982,6 +982,18 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
|
|||||||
return dts;
|
return dts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rm_read_seek(AVFormatContext *s, int stream_index,
|
||||||
|
int64_t pts, int flags)
|
||||||
|
{
|
||||||
|
RMDemuxContext *rm = s->priv_data;
|
||||||
|
|
||||||
|
if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
|
||||||
|
return -1;
|
||||||
|
rm->audio_pkt_cnt = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AVInputFormat ff_rm_demuxer = {
|
AVInputFormat ff_rm_demuxer = {
|
||||||
.name = "rm",
|
.name = "rm",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("RealMedia format"),
|
.long_name = NULL_IF_CONFIG_SMALL("RealMedia format"),
|
||||||
@@ -991,6 +1003,7 @@ AVInputFormat ff_rm_demuxer = {
|
|||||||
.read_packet = rm_read_packet,
|
.read_packet = rm_read_packet,
|
||||||
.read_close = rm_read_close,
|
.read_close = rm_read_close,
|
||||||
.read_timestamp = rm_read_dts,
|
.read_timestamp = rm_read_dts,
|
||||||
|
.read_seek = rm_read_seek,
|
||||||
};
|
};
|
||||||
|
|
||||||
AVInputFormat ff_rdt_demuxer = {
|
AVInputFormat ff_rdt_demuxer = {
|
||||||
|
@@ -281,11 +281,11 @@ int ff_amf_tag_size(const uint8_t *data, const uint8_t *data_end)
|
|||||||
data++;
|
data++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (data + size >= data_end || data + size < data)
|
if (size < 0 || size >= data_end - data)
|
||||||
return -1;
|
return -1;
|
||||||
data += size;
|
data += size;
|
||||||
t = ff_amf_tag_size(data, data_end);
|
t = ff_amf_tag_size(data, data_end);
|
||||||
if (t < 0 || data + t >= data_end)
|
if (t < 0 || t >= data_end - data)
|
||||||
return -1;
|
return -1;
|
||||||
data += t;
|
data += t;
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
|
|||||||
int size = bytestream_get_be16(&data);
|
int size = bytestream_get_be16(&data);
|
||||||
if (!size)
|
if (!size)
|
||||||
break;
|
break;
|
||||||
if (data + size >= data_end || data + size < data)
|
if (size < 0 || size >= data_end - data)
|
||||||
return -1;
|
return -1;
|
||||||
data += size;
|
data += size;
|
||||||
if (size == namelen && !memcmp(data-size, name, namelen)) {
|
if (size == namelen && !memcmp(data-size, name, namelen)) {
|
||||||
@@ -335,7 +335,7 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
len = ff_amf_tag_size(data, data_end);
|
len = ff_amf_tag_size(data, data_end);
|
||||||
if (len < 0 || data + len >= data_end || data + len < data)
|
if (len < 0 || len >= data_end - data)
|
||||||
return -1;
|
return -1;
|
||||||
data += len;
|
data += len;
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,7 @@ static const char* rtmp_packet_type(int type)
|
|||||||
|
|
||||||
static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *data_end)
|
static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *data_end)
|
||||||
{
|
{
|
||||||
int size;
|
unsigned int size;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
||||||
if (data >= data_end)
|
if (data >= data_end)
|
||||||
@@ -384,7 +384,7 @@ static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *d
|
|||||||
} else {
|
} else {
|
||||||
size = bytestream_get_be32(&data);
|
size = bytestream_get_be32(&data);
|
||||||
}
|
}
|
||||||
size = FFMIN(size, 1023);
|
size = FFMIN(size, sizeof(buf) - 1);
|
||||||
memcpy(buf, data, size);
|
memcpy(buf, data, size);
|
||||||
buf[size] = 0;
|
buf[size] = 0;
|
||||||
av_log(ctx, AV_LOG_DEBUG, " string '%s'\n", buf);
|
av_log(ctx, AV_LOG_DEBUG, " string '%s'\n", buf);
|
||||||
@@ -397,22 +397,21 @@ static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *d
|
|||||||
case AMF_DATA_TYPE_OBJECT:
|
case AMF_DATA_TYPE_OBJECT:
|
||||||
av_log(ctx, AV_LOG_DEBUG, " {\n");
|
av_log(ctx, AV_LOG_DEBUG, " {\n");
|
||||||
for (;;) {
|
for (;;) {
|
||||||
int size = bytestream_get_be16(&data);
|
|
||||||
int t;
|
int t;
|
||||||
memcpy(buf, data, size);
|
size = bytestream_get_be16(&data);
|
||||||
buf[size] = 0;
|
av_strlcpy(buf, data, FFMIN(sizeof(buf), size + 1));
|
||||||
if (!size) {
|
if (!size) {
|
||||||
av_log(ctx, AV_LOG_DEBUG, " }\n");
|
av_log(ctx, AV_LOG_DEBUG, " }\n");
|
||||||
data++;
|
data++;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (data + size >= data_end || data + size < data)
|
if (size >= data_end - data)
|
||||||
return;
|
return;
|
||||||
data += size;
|
data += size;
|
||||||
av_log(ctx, AV_LOG_DEBUG, " %s: ", buf);
|
av_log(ctx, AV_LOG_DEBUG, " %s: ", buf);
|
||||||
ff_amf_tag_contents(ctx, data, data_end);
|
ff_amf_tag_contents(ctx, data, data_end);
|
||||||
t = ff_amf_tag_size(data, data_end);
|
t = ff_amf_tag_size(data, data_end);
|
||||||
if (t < 0 || data + t >= data_end)
|
if (t < 0 || t >= data_end - data)
|
||||||
return;
|
return;
|
||||||
data += t;
|
data += t;
|
||||||
}
|
}
|
||||||
|
@@ -31,14 +31,14 @@
|
|||||||
|
|
||||||
static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
|
static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
|
||||||
{
|
{
|
||||||
int res = 0;
|
unsigned int res = 0;
|
||||||
|
|
||||||
if (end - start < nal_length_size)
|
if (end - start < nal_length_size)
|
||||||
return NULL;
|
return NULL;
|
||||||
while (nal_length_size--)
|
while (nal_length_size--)
|
||||||
res = (res << 8) | *start++;
|
res = (res << 8) | *start++;
|
||||||
|
|
||||||
if (start + res > end || res < 0 || start + res < start)
|
if (res > end - start)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
return start + res;
|
return start + res;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user