Compare commits
137 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3429714f3d | ||
![]() |
ee902d3d2d | ||
![]() |
9bc62da980 | ||
![]() |
2a6d16ba5f | ||
![]() |
c7e967a7cb | ||
![]() |
5262c88bb0 | ||
![]() |
bd78b9416d | ||
![]() |
48ae72e501 | ||
![]() |
0f671dfeac | ||
![]() |
345962121d | ||
![]() |
0cbf53bdf5 | ||
![]() |
b20409c690 | ||
![]() |
7997ec54c9 | ||
![]() |
e805826903 | ||
![]() |
137a000377 | ||
![]() |
78c314e39e | ||
![]() |
756d85dc14 | ||
![]() |
eeab3e1b20 | ||
![]() |
a75787a71a | ||
![]() |
09425294c9 | ||
![]() |
3572eaaf02 | ||
![]() |
25da8d84a4 | ||
![]() |
0f642909d8 | ||
![]() |
6252e9141b | ||
![]() |
c65a731b6f | ||
![]() |
58096b70fa | ||
![]() |
0ae93844d0 | ||
![]() |
657dc91b44 | ||
![]() |
352d17086f | ||
![]() |
193440f566 | ||
![]() |
563e542b31 | ||
![]() |
b0b6d8de7e | ||
![]() |
2f5c5767d1 | ||
![]() |
979a54ed18 | ||
![]() |
d11bca8043 | ||
![]() |
a3ef410b9c | ||
![]() |
260e5c6dbe | ||
![]() |
bac6554c74 | ||
![]() |
1e366c15ed | ||
![]() |
675fb3a8af | ||
![]() |
25fc0faccb | ||
![]() |
164083434e | ||
![]() |
8026606497 | ||
![]() |
6ac8ac0109 | ||
![]() |
f07e2ff697 | ||
![]() |
b62b3e1a25 | ||
![]() |
a45b8af839 | ||
![]() |
a443b48ccf | ||
![]() |
a45402d4c0 | ||
![]() |
0bdc64e8b9 | ||
![]() |
5fbf63ea39 | ||
![]() |
4d74bb24e3 | ||
![]() |
7f8d0cf93a | ||
![]() |
28fba55306 | ||
![]() |
7caee17204 | ||
![]() |
edec2a4da3 | ||
![]() |
65074a5dae | ||
![]() |
e3b6144e0c | ||
![]() |
8acbba0ec3 | ||
![]() |
9e9cde6afa | ||
![]() |
4f8814964c | ||
![]() |
8a6770a214 | ||
![]() |
763e6ecf83 | ||
![]() |
07d508e4f5 | ||
![]() |
b089b58250 | ||
![]() |
a7dd37169c | ||
![]() |
3032291b3a | ||
![]() |
f9bbc26e69 | ||
![]() |
b895e29941 | ||
![]() |
3d71024f8a | ||
![]() |
b834dc14da | ||
![]() |
d0041dc8c4 | ||
![]() |
b3c082412c | ||
![]() |
918ed73b70 | ||
![]() |
2791eba1d7 | ||
![]() |
0d3a07852c | ||
![]() |
c7a2ac6b6b | ||
![]() |
0ce35b8ce8 | ||
![]() |
25312a427b | ||
![]() |
9143ab0e5a | ||
![]() |
022bfd3dd4 | ||
![]() |
e0a12b3dc3 | ||
![]() |
252ba4a925 | ||
![]() |
5bb31e856d | ||
![]() |
eac0451e47 | ||
![]() |
68c6347089 | ||
![]() |
bcd7f35717 | ||
![]() |
93cbdcd4d3 | ||
![]() |
959ab06c68 | ||
![]() |
46db3121c6 | ||
![]() |
c96c755320 | ||
![]() |
9f8cdd520b | ||
![]() |
f5631d23e0 | ||
![]() |
50f4543c6b | ||
![]() |
1344e91f33 | ||
![]() |
f13e6ec7a6 | ||
![]() |
bf2c9e1ad4 | ||
![]() |
0663aab1d9 | ||
![]() |
e911f125fc | ||
![]() |
5aead5ee05 | ||
![]() |
3a5b749d7c | ||
![]() |
4b4d0b0290 | ||
![]() |
c9b25252cb | ||
![]() |
4400385d5f | ||
![]() |
d85e25fe0b | ||
![]() |
3d1972d182 | ||
![]() |
71b1abe638 | ||
![]() |
991ef3a67e | ||
![]() |
b850b01533 | ||
![]() |
23a17b4a3d | ||
![]() |
3a8ad4b878 | ||
![]() |
b85a939633 | ||
![]() |
7e130ca5b4 | ||
![]() |
f295f9488a | ||
![]() |
2c01dd2ea5 | ||
![]() |
5e26152ee4 | ||
![]() |
135c733125 | ||
![]() |
3b3a3c3d44 | ||
![]() |
13244abcd3 | ||
![]() |
9783d5bfda | ||
![]() |
0e4efad93c | ||
![]() |
0103bc67fd | ||
![]() |
d5af3fb1c5 | ||
![]() |
6ec5a199ea | ||
![]() |
f7b5366657 | ||
![]() |
542332e523 | ||
![]() |
aa24dd487f | ||
![]() |
3bcd1daad7 | ||
![]() |
91f88eab32 | ||
![]() |
aac467ae17 | ||
![]() |
968e733b2e | ||
![]() |
192d46e6d1 | ||
![]() |
bb8614cb7b | ||
![]() |
d9bdf7d9ae | ||
![]() |
a588e1e560 | ||
![]() |
36e7385d0e | ||
![]() |
5108323aa9 |
95
Changelog
95
Changelog
@ -1,7 +1,98 @@
|
|||||||
Entries are sorted chronologically from oldest to youngest within each release,
|
Entries are sorted chronologically from oldest to youngest within each release,
|
||||||
releases are sorted from youngest to oldest.
|
releases are sorted from youngest to oldest.
|
||||||
|
|
||||||
version <next>:
|
version 2.5.4:
|
||||||
|
- avcodec/arm/videodsp_armv5te: Fix linking failure with shared libs
|
||||||
|
- avcodec/mjpegdec: Skip blocks which are outside the visible area
|
||||||
|
- avcodec/h264_slice: ignore SAR changes in slices after the first
|
||||||
|
- avcodec/h264_slice: Check picture structure before setting the related fields
|
||||||
|
- avcodec/h264_slice: Do not change frame_num after the first slice
|
||||||
|
- avutil/opt: Fix type used to access AV_OPT_TYPE_SAMPLE_FMT
|
||||||
|
- avutil/opt: Fix types used to access AV_OPT_TYPE_PIXEL_FMT
|
||||||
|
- avcodec/h264: Be more strict on rejecting pps/sps changes
|
||||||
|
- avcodec/h264: Be more strict on rejecting pps_id changes
|
||||||
|
- avcodec/h264_ps: More completely check the bit depths
|
||||||
|
- avformat/thp: Check av_get_packet() for failure not only for partial output
|
||||||
|
- swscale/utils: Limit filter shifting so as not to read from prior the array
|
||||||
|
- avcodec/mpegvideo_motion: Fix gmc chroma dimensions
|
||||||
|
- avcodec/mjpegdec: Check number of components for JPEG-LS
|
||||||
|
- avcodec/mjpegdec: Check escape sequence validity
|
||||||
|
- avformat/mpc8: Use uint64_t in *_get_v() to avoid undefined behavior
|
||||||
|
- avformat/mpc8: fix broken pointer math
|
||||||
|
- avformat/mpc8: fix hang with fuzzed file
|
||||||
|
- avformat/tta: fix crash with corrupted files
|
||||||
|
- avcodec/ppc/idctdsp.c: POWER LE support in idct_add_altivec()
|
||||||
|
- swscale/input: fix rgba64 alpha non native
|
||||||
|
- swscale/input: Fix alpha of YA16 input
|
||||||
|
- libavcodec/ppc/mpegvideoencdsp.c: fix stack smashing in pix_norm1_altivec() and pix_sum_altivec()
|
||||||
|
- avformat/rmdec: Check for overflow in ff_rm_read_mdpr_codecdata()
|
||||||
|
- avformat/mpeg: do not count PES packets inside PES packets during probing
|
||||||
|
- hevc: always clip luma_log2_weight_denom
|
||||||
|
- rtpdec_h263_rfc2190: Clear the stored bits if discarding buffered data
|
||||||
|
- aacenc: correctly check returned value
|
||||||
|
- swscale: check memory allocations
|
||||||
|
- opt: check memory allocation
|
||||||
|
- avformat/utils: check for malloc failure
|
||||||
|
- avcodec/flac_parser: fix handling EOF if no headers are found
|
||||||
|
- avfilter/vf_framepack: Check and update frame_rate
|
||||||
|
- vp8: improve memory allocation checks
|
||||||
|
- configure: enable vsx together with altivec for ppc64el
|
||||||
|
- avcodec/hevc: Fix handling of skipped_bytes() reallocation failures
|
||||||
|
- qpeg: avoid pointless invalid memcpy()
|
||||||
|
|
||||||
|
|
||||||
|
version 2.5.3:
|
||||||
|
- vp9: fix parser return values in error case
|
||||||
|
- ffmpeg: Clear error message array at init.
|
||||||
|
- avcodec/dvdsubdec: fix accessing dangling pointers
|
||||||
|
- avcodec/dvdsubdec: error on bitmaps with size 0
|
||||||
|
- cmdutils: Use 64bit for file size/offset related variable in cmdutils_read_file()
|
||||||
|
- mov: Fix negative size calculation in mov_read_default().
|
||||||
|
- avformat/mov: fix integer overflow in mov_read_udta_string()
|
||||||
|
- mov: Fix overflow and error handling in read_tfra().
|
||||||
|
- mov: Avoid overflow with mov_metadata_raw()
|
||||||
|
- avcodec/dvdsubdec: fix out of bounds accesses
|
||||||
|
- avfilter/vf_sab: fix filtering tiny images
|
||||||
|
- avformat/flvdec: Increase string array size
|
||||||
|
- avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
|
||||||
|
- avformat/cdxl: Fix integer overflow of image_size
|
||||||
|
- libavformat: Build hevc.o when building the RTP muxer
|
||||||
|
|
||||||
|
version 2.5.2:
|
||||||
|
- avcodec/indeo3: ensure offsets are non negative
|
||||||
|
- avcodec/h264: Check *log2_weight_denom
|
||||||
|
- avcodec/hevc_ps: Check diff_cu_qp_delta_depth
|
||||||
|
- avcodec/h264: Clear delayed_pic on deallocation
|
||||||
|
- avcodec/hevc: clear filter_slice_edges() on allocation
|
||||||
|
- avcodec/dcadec: Check that the added xch channel isnt already there
|
||||||
|
- avcodec/indeo3: use signed variables to avoid underflow
|
||||||
|
- swscale: increase yuv2rgb table headroom
|
||||||
|
- avformat/mov: fix integer overflow of size
|
||||||
|
- avformat/mov: check atom nesting depth
|
||||||
|
- avcodec/utvideodec: Fix handling of slice_height=0
|
||||||
|
- avcodec/xface: correct the XFACE_MAX_* values
|
||||||
|
- avcodec/vmdvideo: Check len before using it in method 3
|
||||||
|
- configure: create the tests directory like the doc directory
|
||||||
|
- mmvideo: check frame dimensions
|
||||||
|
- jvdec: check frame dimensions
|
||||||
|
|
||||||
|
version 2.5.1:
|
||||||
|
- lavu/frame: fix malloc error path in av_frame_copy_props()
|
||||||
|
- avformat/aviobuf: Check that avio_seek() target is non negative
|
||||||
|
- swresample/soxr_resample: fix error handling
|
||||||
|
- avformat/flvdec: fix potential use of uninitialized variables
|
||||||
|
- avformat/crypto: fix key vs iv typo
|
||||||
|
- configure: use use_pkg_config() instead of check_pkg_config() for libsmbclient
|
||||||
|
- avcodec/ppc/vp3dsp_altivec: POWER LE support to vp3_idct_add_altivec()
|
||||||
|
- avformat/matroskadec: fix handling of recursive SeekHead elements
|
||||||
|
- doc/examples/filtering_video: fix frame rate
|
||||||
|
- avcodec/mpegaudiodec_template: only allocate fdsp when its used
|
||||||
|
- doc/examples/transcoding: check encoder before using it
|
||||||
|
- update MAINTAINERS file
|
||||||
|
- POWER LE support in put_vp8_epel_h_altivec_core() put_vp8_epel_v_altivec_core() put_vp8_pixels16_altivec()
|
||||||
|
- POWER LE support in vc1_inv_trans_8x4_altivec()
|
||||||
|
|
||||||
|
version 2.5:
|
||||||
- HEVC/H.265 RTP payload format (draft v6) packetizer
|
- HEVC/H.265 RTP payload format (draft v6) packetizer
|
||||||
- SUP/PGS subtitle demuxer
|
- SUP/PGS subtitle demuxer
|
||||||
- ffprobe -show_pixel_formats option
|
- ffprobe -show_pixel_formats option
|
||||||
@ -16,7 +107,7 @@ version <next>:
|
|||||||
- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
|
- creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
|
||||||
- WebP muxer with animated WebP support
|
- WebP muxer with animated WebP support
|
||||||
- zygoaudio decoding support
|
- zygoaudio decoding support
|
||||||
- APNG demuxer
|
- APNG decoder and demuxer
|
||||||
- postproc visualization support
|
- postproc visualization support
|
||||||
|
|
||||||
|
|
||||||
|
@ -537,6 +537,7 @@ x86 Michael Niedermayer
|
|||||||
Releases
|
Releases
|
||||||
========
|
========
|
||||||
|
|
||||||
|
2.5 Michael Niedermayer
|
||||||
2.4 Michael Niedermayer
|
2.4 Michael Niedermayer
|
||||||
2.2 Michael Niedermayer
|
2.2 Michael Niedermayer
|
||||||
1.2 Michael Niedermayer
|
1.2 Michael Niedermayer
|
||||||
|
2
Makefile
2
Makefile
@ -112,7 +112,7 @@ endef
|
|||||||
|
|
||||||
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
$(foreach P,$(PROGS),$(eval $(call DOPROG,$(P:$(PROGSSUF)$(EXESUF)=))))
|
||||||
|
|
||||||
ffprobe.o cmdutils.o : libavutil/ffversion.h
|
ffprobe.o cmdutils.o libavcodec/utils.o libavformat/utils.o libavdevice/avdevice.o libavfilter/avfilter.o libavutil/utils.o libpostproc/postprocess.o libswresample/swresample.o libswscale/utils.o : libavutil/ffversion.h
|
||||||
|
|
||||||
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
$(PROGS): %$(PROGSSUF)$(EXESUF): %$(PROGSSUF)_g$(EXESUF)
|
||||||
$(CP) $< $@
|
$(CP) $< $@
|
||||||
|
@ -2,9 +2,13 @@
|
|||||||
│ RELEASE NOTES for FFmpeg 2.5 "Bohr" │
|
│ RELEASE NOTES for FFmpeg 2.5 "Bohr" │
|
||||||
└────────────────────────────────────────┘
|
└────────────────────────────────────────┘
|
||||||
|
|
||||||
The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", just 2.5 months
|
The FFmpeg Project proudly presents FFmpeg 2.5 "Bohr", 2.5 months after the
|
||||||
after the release of 2.4. Since this wasn't a long time ago, the Changelog
|
release of 2.4.
|
||||||
is a bit short this time.
|
|
||||||
|
The most important new features are AVFoundation screen-grabbing support,
|
||||||
|
animated WebP decoding support, and Animated PNG support. In addition, many
|
||||||
|
exciting features for video streaming are also implemented, including MPEG-
|
||||||
|
DASH fragmenting muxer, HEVC RTP payload muxer, and UDP Lite support.
|
||||||
|
|
||||||
As usual, if you have any question on this release or any FFmpeg related
|
As usual, if you have any question on this release or any FFmpeg related
|
||||||
topic, feel free to join us on the #ffmpeg IRC channel (on
|
topic, feel free to join us on the #ffmpeg IRC channel (on
|
||||||
@ -56,6 +60,7 @@
|
|||||||
• libutvideo YUV 4:2:2 10bit support
|
• libutvideo YUV 4:2:2 10bit support
|
||||||
• animated WebP decoding support
|
• animated WebP decoding support
|
||||||
• zygoaudio decoding support
|
• zygoaudio decoding support
|
||||||
|
• APNG decoder
|
||||||
|
|
||||||
┌────────────────────────────┐
|
┌────────────────────────────┐
|
||||||
│ libavdevice │
|
│ libavdevice │
|
||||||
@ -72,7 +77,8 @@
|
|||||||
• SUP/PGS subtitle demuxer
|
• SUP/PGS subtitle demuxer
|
||||||
• STL subtitle demuxer
|
• STL subtitle demuxer
|
||||||
• UDP-Lite support (RFC 3828)
|
• UDP-Lite support (RFC 3828)
|
||||||
• creating DASH compatible fragmented MP4, MPEG-DASH segmenting muxer
|
• MPEG-DASH segmenting muxer, which allows creating DASH compatible
|
||||||
|
fragmented MP4
|
||||||
• WebP muxer
|
• WebP muxer
|
||||||
• APNG demuxer
|
• APNG demuxer
|
||||||
|
|
||||||
@ -93,7 +99,3 @@
|
|||||||
└────────────────────────────┘
|
└────────────────────────────┘
|
||||||
|
|
||||||
• visualization support
|
• visualization support
|
||||||
|
|
||||||
┌────────────────────────────┐
|
|
||||||
│ ⚠ Behaviour changes │
|
|
||||||
└────────────────────────────┘
|
|
||||||
|
@ -1860,7 +1860,7 @@ int read_yesno(void)
|
|||||||
|
|
||||||
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
int cmdutils_read_file(const char *filename, char **bufptr, size_t *size)
|
||||||
{
|
{
|
||||||
int ret;
|
int64_t ret;
|
||||||
FILE *f = av_fopen_utf8(filename, "rb");
|
FILE *f = av_fopen_utf8(filename, "rb");
|
||||||
|
|
||||||
if (!f) {
|
if (!f) {
|
||||||
|
9
configure
vendored
9
configure
vendored
@ -1635,7 +1635,6 @@ HEADERS_LIST="
|
|||||||
asm_types_h
|
asm_types_h
|
||||||
cdio_paranoia_h
|
cdio_paranoia_h
|
||||||
cdio_paranoia_paranoia_h
|
cdio_paranoia_paranoia_h
|
||||||
CL_cl_h
|
|
||||||
dev_bktr_ioctl_bt848_h
|
dev_bktr_ioctl_bt848_h
|
||||||
dev_bktr_ioctl_meteor_h
|
dev_bktr_ioctl_meteor_h
|
||||||
dev_ic_bt8xx_h
|
dev_ic_bt8xx_h
|
||||||
@ -4413,7 +4412,7 @@ unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
|
|||||||
EOF
|
EOF
|
||||||
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
|
od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
|
||||||
|
|
||||||
if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] ;then
|
if [ "$cpu" = "power7" ] || [ "$cpu" = "power8" ] || enabled ppc64; then
|
||||||
if ! enabled bigendian && enabled altivec ;then
|
if ! enabled bigendian && enabled altivec ;then
|
||||||
enable vsx
|
enable vsx
|
||||||
fi
|
fi
|
||||||
@ -4756,7 +4755,6 @@ check_func_headers glob.h glob
|
|||||||
enabled xlib &&
|
enabled xlib &&
|
||||||
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
|
check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
|
||||||
|
|
||||||
check_header cl/cl.h
|
|
||||||
check_header direct.h
|
check_header direct.h
|
||||||
check_header dlfcn.h
|
check_header dlfcn.h
|
||||||
check_header dxva.h
|
check_header dxva.h
|
||||||
@ -4883,7 +4881,7 @@ enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
|
|||||||
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
|
enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
|
||||||
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
|
enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
|
||||||
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
|
enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
|
||||||
enabled libsmbclient && { check_pkg_config smbclient libsmbclient.h smbc_init ||
|
enabled libsmbclient && { use_pkg_config smbclient libsmbclient.h smbc_init ||
|
||||||
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
require smbclient libsmbclient.h smbc_init -lsmbclient; }
|
||||||
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
|
||||||
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
|
||||||
@ -5678,7 +5676,7 @@ cat > $TMPH <<EOF
|
|||||||
#define FFMPEG_CONFIG_H
|
#define FFMPEG_CONFIG_H
|
||||||
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
|
||||||
#define FFMPEG_LICENSE "$(c_escape $license)"
|
#define FFMPEG_LICENSE "$(c_escape $license)"
|
||||||
#define CONFIG_THIS_YEAR 2014
|
#define CONFIG_THIS_YEAR 2015
|
||||||
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
|
||||||
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
#define AVCONV_DATADIR "$(eval c_escape $datadir)"
|
||||||
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
|
||||||
@ -5706,6 +5704,7 @@ enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
|
|||||||
|
|
||||||
|
|
||||||
mkdir -p doc
|
mkdir -p doc
|
||||||
|
mkdir -p tests
|
||||||
echo "@c auto-generated by configure" > doc/config.texi
|
echo "@c auto-generated by configure" > doc/config.texi
|
||||||
|
|
||||||
print_config ARCH_ "$config_files" $ARCH_LIST
|
print_config ARCH_ "$config_files" $ARCH_LIST
|
||||||
|
@ -200,7 +200,7 @@ API changes, most recent first:
|
|||||||
Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
|
Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
|
||||||
it
|
it
|
||||||
|
|
||||||
2014-06-10 - xxxxxxx - lavf 55.43.100 - avformat.h
|
2014-06-10 - 5482780 - lavf 55.43.100 - avformat.h
|
||||||
New field int64_t max_analyze_duration2 instead of deprecated
|
New field int64_t max_analyze_duration2 instead of deprecated
|
||||||
int max_analyze_duration.
|
int max_analyze_duration.
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ API changes, most recent first:
|
|||||||
Add strict_std_compliance and related AVOptions to support experimental
|
Add strict_std_compliance and related AVOptions to support experimental
|
||||||
muxing.
|
muxing.
|
||||||
|
|
||||||
2014-05-26 - xxxxxxx - lavu 52.87.100 - threadmessage.h
|
2014-05-26 - 55cc60c - lavu 52.87.100 - threadmessage.h
|
||||||
Add thread message queue API.
|
Add thread message queue API.
|
||||||
|
|
||||||
2014-05-26 - c37d179 - lavf 55.41.100 - avformat.h
|
2014-05-26 - c37d179 - lavf 55.41.100 - avformat.h
|
||||||
@ -234,7 +234,7 @@ API changes, most recent first:
|
|||||||
Add av_stream_get_side_data() to access stream-level side data
|
Add av_stream_get_side_data() to access stream-level side data
|
||||||
in the same way as av_packet_get_side_data().
|
in the same way as av_packet_get_side_data().
|
||||||
|
|
||||||
2014-05-xx - xxxxxxx - lavu 52.86.100 - fifo.h
|
2014-05-20 - 7336e39 - lavu 52.86.100 - fifo.h
|
||||||
Add av_fifo_alloc_array() function.
|
Add av_fifo_alloc_array() function.
|
||||||
|
|
||||||
2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
|
2014-05-19 - ef1d4ee / bddd8cb - lavu 52.85.100 / 53.15.0 - frame.h, display.h
|
||||||
@ -266,7 +266,7 @@ API changes, most recent first:
|
|||||||
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
|
2014-05-11 - 14aef38 / 66e6c8a - lavu 52.83.100 / 53.14.0 - pixfmt.h
|
||||||
Add AV_PIX_FMT_VDA for new-style VDA acceleration.
|
Add AV_PIX_FMT_VDA for new-style VDA acceleration.
|
||||||
|
|
||||||
2014-05-xx - xxxxxxx - lavu 52.82.100 - fifo.h
|
2014-05-07 - 351f611 - lavu 52.82.100 - fifo.h
|
||||||
Add av_fifo_freep() function.
|
Add av_fifo_freep() function.
|
||||||
|
|
||||||
2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
|
2014-05-02 - ba52fb11 - lavu 52.81.100 - opt.h
|
||||||
@ -288,10 +288,14 @@ API changes, most recent first:
|
|||||||
Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
|
Deprecate CODEC_FLAG_INPUT_PRESERVED. Its functionality is replaced by passing
|
||||||
reference-counted frames to encoders.
|
reference-counted frames to encoders.
|
||||||
|
|
||||||
|
2014-04-30 - 617e866 - lavu 52.81.100 - pixdesc.h
|
||||||
|
Add av_find_best_pix_fmt_of_2(), av_get_pix_fmt_loss()
|
||||||
|
Deprecate avcodec_get_pix_fmt_loss(), avcodec_find_best_pix_fmt_of_2()
|
||||||
|
|
||||||
2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
|
2014-04-29 - 1bf6396 - lavc 55.60.100 - avcodec.h
|
||||||
Add AVCodecDescriptor.mime_types field.
|
Add AVCodecDescriptor.mime_types field.
|
||||||
|
|
||||||
2014-04-29 - xxxxxxx - lavu 52.80.0 - hash.h
|
2014-04-29 - b804eb4 - lavu 52.80.100 - hash.h
|
||||||
Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().
|
Add av_hash_final_bin(), av_hash_final_hex() and av_hash_final_b64().
|
||||||
|
|
||||||
2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
|
2014-03-07 - 8b2a130 - lavc 55.50.0 / 55.53.100 - dxva2.h
|
||||||
@ -303,7 +307,7 @@ API changes, most recent first:
|
|||||||
2014-04-17 - a8d01a7 / 0983d48 - lavu 53.12.0 / 52.77.100 - crc.h
|
2014-04-17 - a8d01a7 / 0983d48 - lavu 53.12.0 / 52.77.100 - crc.h
|
||||||
Add AV_CRC_16_ANSI_LE crc variant.
|
Add AV_CRC_16_ANSI_LE crc variant.
|
||||||
|
|
||||||
2014-04-XX - xxxxxxx - lavf xx.xx.1xx - avformat.h
|
2014-04-15 - ef818d8 - lavf 55.37.101 - avformat.h
|
||||||
Add av_format_inject_global_side_data()
|
Add av_format_inject_global_side_data()
|
||||||
|
|
||||||
2014-04-12 - 4f698be - lavu 52.76.100 - log.h
|
2014-04-12 - 4f698be - lavu 52.76.100 - log.h
|
||||||
@ -383,7 +387,7 @@ API changes, most recent first:
|
|||||||
2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
|
2014-02-19 - f4c8d00 / 6bb8720 - lavu 52.64.101 / 53.3.1 - opt.h
|
||||||
Deprecate unused AV_OPT_FLAG_METADATA.
|
Deprecate unused AV_OPT_FLAG_METADATA.
|
||||||
|
|
||||||
2014-02-xx - xxxxxxx - lavd 55.10.100 - avdevice.h
|
2014-02-16 - 81c3f81 - lavd 55.10.100 - avdevice.h
|
||||||
Add avdevice_list_devices() and avdevice_free_list_devices()
|
Add avdevice_list_devices() and avdevice_free_list_devices()
|
||||||
|
|
||||||
2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
|
2014-02-16 - db3c970 - lavf 55.33.100 - avio.h
|
||||||
@ -424,7 +428,7 @@ API changes, most recent first:
|
|||||||
2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
|
2014-01-19 - 1a193c4 - lavf 55.25.100 - avformat.h
|
||||||
Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
|
Add avformat_get_mov_video_tags() and avformat_get_mov_audio_tags().
|
||||||
|
|
||||||
2014-01-19 - xxxxxxx - lavu 52.63.100 - rational.h
|
2014-01-19 - 3532dd5 - lavu 52.63.100 - rational.h
|
||||||
Add av_make_q() function.
|
Add av_make_q() function.
|
||||||
|
|
||||||
2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h
|
2014-01-05 - 4cf4da9 / 5b4797a - lavu 52.62.100 / 53.2.0 - frame.h
|
||||||
|
@ -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 = 2.5.4
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify a logo or icon that is included
|
# With the PROJECT_LOGO tag one can specify a 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
|
||||||
|
@ -29,6 +29,7 @@ OBJS=$(addsuffix .o,$(EXAMPLES))
|
|||||||
|
|
||||||
# the following examples make explicit use of the math library
|
# the following examples make explicit use of the math library
|
||||||
avcodec: LDLIBS += -lm
|
avcodec: LDLIBS += -lm
|
||||||
|
decoding_encoding: LDLIBS += -lm
|
||||||
muxing: LDLIBS += -lm
|
muxing: LDLIBS += -lm
|
||||||
resampling_audio: LDLIBS += -lm
|
resampling_audio: LDLIBS += -lm
|
||||||
|
|
||||||
|
@ -90,6 +90,7 @@ static int init_filters(const char *filters_descr)
|
|||||||
AVFilter *buffersink = avfilter_get_by_name("buffersink");
|
AVFilter *buffersink = avfilter_get_by_name("buffersink");
|
||||||
AVFilterInOut *outputs = avfilter_inout_alloc();
|
AVFilterInOut *outputs = avfilter_inout_alloc();
|
||||||
AVFilterInOut *inputs = avfilter_inout_alloc();
|
AVFilterInOut *inputs = avfilter_inout_alloc();
|
||||||
|
AVRational time_base = fmt_ctx->streams[video_stream_index]->time_base;
|
||||||
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE };
|
||||||
|
|
||||||
filter_graph = avfilter_graph_alloc();
|
filter_graph = avfilter_graph_alloc();
|
||||||
@ -102,7 +103,7 @@ static int init_filters(const char *filters_descr)
|
|||||||
snprintf(args, sizeof(args),
|
snprintf(args, sizeof(args),
|
||||||
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
|
"video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d",
|
||||||
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
|
dec_ctx->width, dec_ctx->height, dec_ctx->pix_fmt,
|
||||||
dec_ctx->time_base.num, dec_ctx->time_base.den,
|
time_base.num, time_base.den,
|
||||||
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
|
dec_ctx->sample_aspect_ratio.num, dec_ctx->sample_aspect_ratio.den);
|
||||||
|
|
||||||
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
|
ret = avfilter_graph_create_filter(&buffersrc_ctx, buffersrc, "in",
|
||||||
|
@ -116,6 +116,10 @@ static int open_output_file(const char *filename)
|
|||||||
|| dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
|| dec_ctx->codec_type == AVMEDIA_TYPE_AUDIO) {
|
||||||
/* in this example, we choose transcoding to same codec */
|
/* in this example, we choose transcoding to same codec */
|
||||||
encoder = avcodec_find_encoder(dec_ctx->codec_id);
|
encoder = avcodec_find_encoder(dec_ctx->codec_id);
|
||||||
|
if (!encoder) {
|
||||||
|
av_log(NULL, AV_LOG_FATAL, "Neccessary encoder not found\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
/* In this example, we transcode to same properties (picture size,
|
/* In this example, we transcode to same properties (picture size,
|
||||||
* sample rate etc.). These properties can be changed for output
|
* sample rate etc.). These properties can be changed for output
|
||||||
|
2
ffmpeg.c
2
ffmpeg.c
@ -2521,7 +2521,7 @@ static int transcode_init(void)
|
|||||||
AVFormatContext *oc;
|
AVFormatContext *oc;
|
||||||
OutputStream *ost;
|
OutputStream *ost;
|
||||||
InputStream *ist;
|
InputStream *ist;
|
||||||
char error[1024];
|
char error[1024] = {0};
|
||||||
int want_sdp = 1;
|
int want_sdp = 1;
|
||||||
|
|
||||||
for (i = 0; i < nb_filtergraphs; i++) {
|
for (i = 0; i < nb_filtergraphs; i++) {
|
||||||
|
@ -2780,7 +2780,7 @@ static void spectral_to_sample(AACContext *ac)
|
|||||||
apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
|
apply_channel_coupling(ac, che, type, i, AFTER_IMDCT, apply_independent_coupling);
|
||||||
che->present = 0;
|
che->present = 0;
|
||||||
} else if (che) {
|
} else if (che) {
|
||||||
av_log(ac->avctx, AV_LOG_WARNING, "ChannelElement %d.%d missing \n", type, i);
|
av_log(ac->avctx, AV_LOG_VERBOSE, "ChannelElement %d.%d missing \n", type, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -753,10 +753,10 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
s->chan_map = aac_chan_configs[s->channels-1];
|
s->chan_map = aac_chan_configs[s->channels-1];
|
||||||
|
|
||||||
if (ret = dsp_init(avctx, s))
|
if ((ret = dsp_init(avctx, s)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (ret = alloc_buffers(avctx, s))
|
if ((ret = alloc_buffers(avctx, s)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
avctx->extradata_size = 5;
|
avctx->extradata_size = 5;
|
||||||
@ -768,7 +768,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
|
|||||||
lengths[1] = ff_aac_num_swb_128[i];
|
lengths[1] = ff_aac_num_swb_128[i];
|
||||||
for (i = 0; i < s->chan_map[0]; i++)
|
for (i = 0; i < s->chan_map[0]; i++)
|
||||||
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
|
grouping[i] = s->chan_map[i + 1] == TYPE_CPE;
|
||||||
if (ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths, s->chan_map[0], grouping))
|
if ((ret = ff_psy_init(&s->psy, avctx, 2, sizes, lengths,
|
||||||
|
s->chan_map[0], grouping)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
s->psypp = ff_psy_preprocess_init(avctx);
|
s->psypp = ff_psy_preprocess_init(avctx);
|
||||||
s->coder = &ff_aac_coders[s->options.aac_coder];
|
s->coder = &ff_aac_coders[s->options.aac_coder];
|
||||||
|
@ -78,6 +78,7 @@ av_cold void ff_h264dsp_init_aarch64(H264DSPContext *c, const int bit_depth,
|
|||||||
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||||
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||||
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
|
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
|
||||||
|
if (chroma_format_idc <= 1)
|
||||||
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
|
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
|
||||||
|
|
||||||
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
|
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
|
||||||
|
@ -23,9 +23,10 @@
|
|||||||
#include "libavutil/arm/asm.S"
|
#include "libavutil/arm/asm.S"
|
||||||
|
|
||||||
function ff_prefetch_arm, export=1
|
function ff_prefetch_arm, export=1
|
||||||
|
1:
|
||||||
subs r2, r2, #1
|
subs r2, r2, #1
|
||||||
pld [r0]
|
pld [r0]
|
||||||
add r0, r0, r1
|
add r0, r0, r1
|
||||||
bne X(ff_prefetch_arm)
|
bne 1b
|
||||||
bx lr
|
bx lr
|
||||||
endfunc
|
endfunc
|
||||||
|
@ -2360,6 +2360,10 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
|||||||
#else
|
#else
|
||||||
if (s->xch_present && !s->xch_disable) {
|
if (s->xch_present && !s->xch_disable) {
|
||||||
#endif
|
#endif
|
||||||
|
if (avctx->channel_layout & AV_CH_BACK_CENTER) {
|
||||||
|
avpriv_request_sample(avctx, "XCh with Back center channel");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
avctx->channel_layout |= AV_CH_BACK_CENTER;
|
avctx->channel_layout |= AV_CH_BACK_CENTER;
|
||||||
if (s->lfe) {
|
if (s->lfe) {
|
||||||
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
|
avctx->channel_layout |= AV_CH_LOW_FREQUENCY;
|
||||||
|
@ -39,7 +39,7 @@ typedef struct DVDSubContext
|
|||||||
int has_palette;
|
int has_palette;
|
||||||
uint8_t colormap[4];
|
uint8_t colormap[4];
|
||||||
uint8_t alpha[256];
|
uint8_t alpha[256];
|
||||||
uint8_t *buf;
|
uint8_t buf[0x10000];
|
||||||
int buf_size;
|
int buf_size;
|
||||||
int forced_subs_only;
|
int forced_subs_only;
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
@ -108,6 +108,12 @@ static int decode_rle(uint8_t *bitmap, int linesize, int w, int h,
|
|||||||
int x, y, len, color;
|
int x, y, len, color;
|
||||||
uint8_t *d;
|
uint8_t *d;
|
||||||
|
|
||||||
|
if (start >= buf_size)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
if (w <= 0 || h <= 0)
|
||||||
|
return -1;
|
||||||
|
|
||||||
bit_len = (buf_size - start) * 8;
|
bit_len = (buf_size - start) * 8;
|
||||||
init_get_bits(&gb, buf + start, bit_len);
|
init_get_bits(&gb, buf + start, bit_len);
|
||||||
|
|
||||||
@ -359,10 +365,12 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
|||||||
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
sub_header->rects[0] = av_mallocz(sizeof(AVSubtitleRect));
|
||||||
sub_header->num_rects = 1;
|
sub_header->num_rects = 1;
|
||||||
sub_header->rects[0]->pict.data[0] = bitmap;
|
sub_header->rects[0]->pict.data[0] = bitmap;
|
||||||
decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
if (decode_rle(bitmap, w * 2, w, (h + 1) / 2,
|
||||||
buf, offset1, buf_size, is_8bit);
|
buf, offset1, buf_size, is_8bit) < 0)
|
||||||
decode_rle(bitmap + w, w * 2, w, h / 2,
|
goto fail;
|
||||||
buf, offset2, buf_size, is_8bit);
|
if (decode_rle(bitmap + w, w * 2, w, h / 2,
|
||||||
|
buf, offset2, buf_size, is_8bit) < 0)
|
||||||
|
goto fail;
|
||||||
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
sub_header->rects[0]->pict.data[1] = av_mallocz(AVPALETTE_SIZE);
|
||||||
if (is_8bit) {
|
if (is_8bit) {
|
||||||
if (!yuv_palette)
|
if (!yuv_palette)
|
||||||
@ -501,15 +509,11 @@ static int append_to_cached_buf(AVCodecContext *avctx,
|
|||||||
{
|
{
|
||||||
DVDSubContext *ctx = avctx->priv_data;
|
DVDSubContext *ctx = avctx->priv_data;
|
||||||
|
|
||||||
if (ctx->buf_size > 0xffff - buf_size) {
|
if (ctx->buf_size >= sizeof(ctx->buf) - buf_size) {
|
||||||
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
av_log(avctx, AV_LOG_WARNING, "Attempt to reconstruct "
|
||||||
"too large SPU packets aborted.\n");
|
"too large SPU packets aborted.\n");
|
||||||
av_freep(&ctx->buf);
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
ctx->buf = av_realloc(ctx->buf, ctx->buf_size + buf_size);
|
|
||||||
if (!ctx->buf)
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
|
memcpy(ctx->buf + ctx->buf_size, buf, buf_size);
|
||||||
ctx->buf_size += buf_size;
|
ctx->buf_size += buf_size;
|
||||||
return 0;
|
return 0;
|
||||||
@ -525,7 +529,7 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
|||||||
AVSubtitle *sub = data;
|
AVSubtitle *sub = data;
|
||||||
int is_menu;
|
int is_menu;
|
||||||
|
|
||||||
if (ctx->buf) {
|
if (ctx->buf_size) {
|
||||||
int ret = append_to_cached_buf(avctx, buf, buf_size);
|
int ret = append_to_cached_buf(avctx, buf, buf_size);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
*data_size = 0;
|
*data_size = 0;
|
||||||
@ -567,7 +571,6 @@ static int dvdsub_decode(AVCodecContext *avctx,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
av_freep(&ctx->buf);
|
|
||||||
ctx->buf_size = 0;
|
ctx->buf_size = 0;
|
||||||
*data_size = 1;
|
*data_size = 1;
|
||||||
return buf_size;
|
return buf_size;
|
||||||
@ -711,7 +714,6 @@ static av_cold int dvdsub_init(AVCodecContext *avctx)
|
|||||||
static av_cold int dvdsub_close(AVCodecContext *avctx)
|
static av_cold int dvdsub_close(AVCodecContext *avctx)
|
||||||
{
|
{
|
||||||
DVDSubContext *ctx = avctx->priv_data;
|
DVDSubContext *ctx = avctx->priv_data;
|
||||||
av_freep(&ctx->buf);
|
|
||||||
ctx->buf_size = 0;
|
ctx->buf_size = 0;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,7 @@ static int dxtory_decode_v1_410(AVCodecContext *avctx, AVFrame *pic,
|
|||||||
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
uint8_t *Y1, *Y2, *Y3, *Y4, *U, *V;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (src_size < avctx->width * avctx->height * 9L / 8) {
|
if (src_size < avctx->width * avctx->height * 9LL / 8) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ static int dxtory_decode_v1_420(AVCodecContext *avctx, AVFrame *pic,
|
|||||||
uint8_t *Y1, *Y2, *U, *V;
|
uint8_t *Y1, *Y2, *U, *V;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (src_size < avctx->width * avctx->height * 3L / 2) {
|
if (src_size < avctx->width * avctx->height * 3LL / 2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
@ -145,7 +145,7 @@ static int dxtory_decode_v1_444(AVCodecContext *avctx, AVFrame *pic,
|
|||||||
uint8_t *Y, *U, *V;
|
uint8_t *Y, *U, *V;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (src_size < avctx->width * avctx->height * 3L) {
|
if (src_size < avctx->width * avctx->height * 3LL) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
av_log(avctx, AV_LOG_ERROR, "packet too small\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
@ -697,7 +697,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
|
|||||||
handle_error:
|
handle_error:
|
||||||
*poutbuf = NULL;
|
*poutbuf = NULL;
|
||||||
*poutbuf_size = 0;
|
*poutbuf_size = 0;
|
||||||
return read_end - buf;
|
return buf_size ? read_end - buf : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int flac_parse_init(AVCodecParserContext *c)
|
static av_cold int flac_parse_init(AVCodecParserContext *c)
|
||||||
|
@ -391,6 +391,7 @@ void ff_h264_free_tables(H264Context *h, int free_rbsp)
|
|||||||
if (free_rbsp && h->DPB) {
|
if (free_rbsp && h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
ff_h264_unref_picture(h, &h->DPB[i]);
|
ff_h264_unref_picture(h, &h->DPB[i]);
|
||||||
|
memset(h->delayed_pic, 0, sizeof(h->delayed_pic));
|
||||||
av_freep(&h->DPB);
|
av_freep(&h->DPB);
|
||||||
} else if (h->DPB) {
|
} else if (h->DPB) {
|
||||||
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
for (i = 0; i < H264_MAX_PICTURE_COUNT; i++)
|
||||||
@ -990,6 +991,16 @@ int ff_pred_weight_table(H264Context *h)
|
|||||||
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->luma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
if (h->sps.chroma_format_idc)
|
if (h->sps.chroma_format_idc)
|
||||||
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
h->chroma_log2_weight_denom = get_ue_golomb(&h->gb);
|
||||||
|
|
||||||
|
if (h->luma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "luma_log2_weight_denom %d is out of range\n", h->luma_log2_weight_denom);
|
||||||
|
h->luma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
if (h->chroma_log2_weight_denom > 7U) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "chroma_log2_weight_denom %d is out of range\n", h->chroma_log2_weight_denom);
|
||||||
|
h->chroma_log2_weight_denom = 0;
|
||||||
|
}
|
||||||
|
|
||||||
luma_def = 1 << h->luma_log2_weight_denom;
|
luma_def = 1 << h->luma_log2_weight_denom;
|
||||||
chroma_def = 1 << h->chroma_log2_weight_denom;
|
chroma_def = 1 << h->chroma_log2_weight_denom;
|
||||||
|
|
||||||
@ -1504,8 +1515,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
again:
|
again:
|
||||||
if ( !(avctx->active_thread_type & FF_THREAD_FRAME)
|
if ( (!(avctx->active_thread_type & FF_THREAD_FRAME) || nals_needed >= nal_index)
|
||||||
|| nals_needed >= nal_index)
|
&& !h->current_slice)
|
||||||
h->au_pps_id = -1;
|
h->au_pps_id = -1;
|
||||||
/* Ignore per frame NAL unit type during extradata
|
/* Ignore per frame NAL unit type during extradata
|
||||||
* parsing. Decoding slices is not possible in codec init
|
* parsing. Decoding slices is not possible in codec init
|
||||||
|
@ -338,6 +338,7 @@ typedef struct H264Picture {
|
|||||||
* H264Context
|
* H264Context
|
||||||
*/
|
*/
|
||||||
typedef struct H264Context {
|
typedef struct H264Context {
|
||||||
|
AVClass *av_class;
|
||||||
AVCodecContext *avctx;
|
AVCodecContext *avctx;
|
||||||
MECmpContext mecc;
|
MECmpContext mecc;
|
||||||
VideoDSPContext vdsp;
|
VideoDSPContext vdsp;
|
||||||
|
@ -1282,7 +1282,7 @@ void ff_h264_init_cabac_states(H264Context *h) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int decode_cabac_field_decoding_flag(H264Context *h) {
|
static int decode_cabac_field_decoding_flag(H264Context *h) {
|
||||||
const long mbb_xy = h->mb_xy - 2L*h->mb_stride;
|
const int mbb_xy = h->mb_xy - 2*h->mb_stride;
|
||||||
|
|
||||||
unsigned long ctx = 0;
|
unsigned long ctx = 0;
|
||||||
|
|
||||||
|
@ -371,7 +371,8 @@ int ff_h264_decode_seq_parameter_set(H264Context *h)
|
|||||||
"Different chroma and luma bit depth");
|
"Different chroma and luma bit depth");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
if (sps->bit_depth_luma > 14U || sps->bit_depth_chroma > 14U) {
|
if (sps->bit_depth_luma < 8 || sps->bit_depth_luma > 14 ||
|
||||||
|
sps->bit_depth_chroma < 8 || sps->bit_depth_chroma > 14) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
av_log(h->avctx, AV_LOG_ERROR, "illegal bit depth value (%d, %d)\n",
|
||||||
sps->bit_depth_luma, sps->bit_depth_chroma);
|
sps->bit_depth_luma, sps->bit_depth_chroma);
|
||||||
goto fail;
|
goto fail;
|
||||||
|
@ -1305,6 +1305,9 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
int must_reinit;
|
int must_reinit;
|
||||||
int needs_reinit = 0;
|
int needs_reinit = 0;
|
||||||
int field_pic_flag, bottom_field_flag;
|
int field_pic_flag, bottom_field_flag;
|
||||||
|
int first_slice = h == h0 && !h0->current_slice;
|
||||||
|
int frame_num, picture_structure, droppable;
|
||||||
|
PPS *pps;
|
||||||
|
|
||||||
h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
|
h->qpel_put = h->h264qpel.put_h264_qpel_pixels_tab;
|
||||||
h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
|
h->qpel_avg = h->h264qpel.avg_h264_qpel_pixels_tab;
|
||||||
@ -1378,18 +1381,27 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
h0->au_pps_id, pps_id);
|
h0->au_pps_id, pps_id);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
h->pps = *h0->pps_buffers[pps_id];
|
|
||||||
|
|
||||||
if (!h0->sps_buffers[h->pps.sps_id]) {
|
pps = h0->pps_buffers[pps_id];
|
||||||
|
|
||||||
|
if (!h0->sps_buffers[pps->sps_id]) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
"non-existing SPS %u referenced\n",
|
"non-existing SPS %u referenced\n",
|
||||||
h->pps.sps_id);
|
h->pps.sps_id);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
if (first_slice)
|
||||||
|
h->pps = *h0->pps_buffers[pps_id];
|
||||||
|
|
||||||
if (h->pps.sps_id != h->sps.sps_id ||
|
if (pps->sps_id != h->sps.sps_id ||
|
||||||
h->pps.sps_id != h->current_sps_id ||
|
pps->sps_id != h->current_sps_id ||
|
||||||
h0->sps_buffers[h->pps.sps_id]->new) {
|
h0->sps_buffers[pps->sps_id]->new) {
|
||||||
|
|
||||||
|
if (!first_slice) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
|
"SPS changed in the middle of the frame\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
h->sps = *h0->sps_buffers[h->pps.sps_id];
|
h->sps = *h0->sps_buffers[h->pps.sps_id];
|
||||||
|
|
||||||
@ -1419,13 +1431,15 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
|| 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
|
|| 16*h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag) != h->avctx->coded_height
|
||||||
|| h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
|
|| h->avctx->bits_per_raw_sample != h->sps.bit_depth_luma
|
||||||
|| h->cur_chroma_format_idc != h->sps.chroma_format_idc
|
|| h->cur_chroma_format_idc != h->sps.chroma_format_idc
|
||||||
|| av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio)
|
|
||||||
|| h->mb_width != h->sps.mb_width
|
|| h->mb_width != h->sps.mb_width
|
||||||
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
|| h->mb_height != h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag)
|
||||||
));
|
));
|
||||||
if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
|
if (non_j_pixfmt(h0->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h0, 0)))
|
||||||
must_reinit = 1;
|
must_reinit = 1;
|
||||||
|
|
||||||
|
if (first_slice && av_cmp_q(h->sps.sar, h->avctx->sample_aspect_ratio))
|
||||||
|
must_reinit = 1;
|
||||||
|
|
||||||
h->mb_width = h->sps.mb_width;
|
h->mb_width = h->sps.mb_width;
|
||||||
h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
|
h->mb_height = h->sps.mb_height * (2 - h->sps.frame_mbs_only_flag);
|
||||||
h->mb_num = h->mb_width * h->mb_height;
|
h->mb_num = h->mb_width * h->mb_height;
|
||||||
@ -1466,6 +1480,8 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
av_assert1(first_slice);
|
||||||
|
|
||||||
ff_h264_flush_change(h);
|
ff_h264_flush_change(h);
|
||||||
|
|
||||||
if ((ret = get_pixel_format(h, 1)) < 0)
|
if ((ret = get_pixel_format(h, 1)) < 0)
|
||||||
@ -1504,39 +1520,43 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
h264_init_dequant_tables(h);
|
h264_init_dequant_tables(h);
|
||||||
}
|
}
|
||||||
|
|
||||||
h->frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
|
frame_num = get_bits(&h->gb, h->sps.log2_max_frame_num);
|
||||||
|
if (!first_slice) {
|
||||||
|
if (h0->frame_num != frame_num) {
|
||||||
|
av_log(h->avctx, AV_LOG_ERROR, "Frame num change from %d to %d\n",
|
||||||
|
h0->frame_num, frame_num);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
h->mb_mbaff = 0;
|
h->mb_mbaff = 0;
|
||||||
h->mb_aff_frame = 0;
|
h->mb_aff_frame = 0;
|
||||||
last_pic_structure = h0->picture_structure;
|
last_pic_structure = h0->picture_structure;
|
||||||
last_pic_droppable = h0->droppable;
|
last_pic_droppable = h0->droppable;
|
||||||
h->droppable = h->nal_ref_idc == 0;
|
droppable = h->nal_ref_idc == 0;
|
||||||
if (h->sps.frame_mbs_only_flag) {
|
if (h->sps.frame_mbs_only_flag) {
|
||||||
h->picture_structure = PICT_FRAME;
|
picture_structure = PICT_FRAME;
|
||||||
} else {
|
} else {
|
||||||
if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
|
if (!h->sps.direct_8x8_inference_flag && slice_type == AV_PICTURE_TYPE_B) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
|
av_log(h->avctx, AV_LOG_ERROR, "This stream was generated by a broken encoder, invalid 8x8 inference\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
field_pic_flag = get_bits1(&h->gb);
|
field_pic_flag = get_bits1(&h->gb);
|
||||||
|
|
||||||
if (field_pic_flag) {
|
if (field_pic_flag) {
|
||||||
bottom_field_flag = get_bits1(&h->gb);
|
bottom_field_flag = get_bits1(&h->gb);
|
||||||
h->picture_structure = PICT_TOP_FIELD + bottom_field_flag;
|
picture_structure = PICT_TOP_FIELD + bottom_field_flag;
|
||||||
} else {
|
} else {
|
||||||
h->picture_structure = PICT_FRAME;
|
picture_structure = PICT_FRAME;
|
||||||
h->mb_aff_frame = h->sps.mb_aff;
|
h->mb_aff_frame = h->sps.mb_aff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
h->mb_field_decoding_flag = h->picture_structure != PICT_FRAME;
|
if (h0->current_slice) {
|
||||||
|
if (last_pic_structure != picture_structure ||
|
||||||
if (h0->current_slice != 0) {
|
last_pic_droppable != droppable) {
|
||||||
if (last_pic_structure != h->picture_structure ||
|
|
||||||
last_pic_droppable != h->droppable) {
|
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
"Changing field mode (%d -> %d) between slices is not allowed\n",
|
"Changing field mode (%d -> %d) between slices is not allowed\n",
|
||||||
last_pic_structure, h->picture_structure);
|
last_pic_structure, h->picture_structure);
|
||||||
h->picture_structure = last_pic_structure;
|
|
||||||
h->droppable = last_pic_droppable;
|
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
} else if (!h0->cur_pic_ptr) {
|
} else if (!h0->cur_pic_ptr) {
|
||||||
av_log(h->avctx, AV_LOG_ERROR,
|
av_log(h->avctx, AV_LOG_ERROR,
|
||||||
@ -1544,7 +1564,14 @@ int ff_h264_decode_slice_header(H264Context *h, H264Context *h0)
|
|||||||
h0->current_slice + 1);
|
h0->current_slice + 1);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
h->picture_structure = picture_structure;
|
||||||
|
h->droppable = droppable;
|
||||||
|
h->frame_num = frame_num;
|
||||||
|
h->mb_field_decoding_flag = picture_structure != PICT_FRAME;
|
||||||
|
|
||||||
|
if (h0->current_slice == 0) {
|
||||||
/* Shorten frame num gaps so we don't have to allocate reference
|
/* Shorten frame num gaps so we don't have to allocate reference
|
||||||
* frames just to throw them away */
|
* frames just to throw them away */
|
||||||
if (h->frame_num != h->prev_frame_num) {
|
if (h->frame_num != h->prev_frame_num) {
|
||||||
|
@ -108,7 +108,7 @@ static int pic_arrays_init(HEVCContext *s, const HEVCSPS *sps)
|
|||||||
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
|
if (!s->tab_ipm || !s->cbf_luma || !s->is_pcm)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
s->filter_slice_edges = av_malloc(ctb_count);
|
s->filter_slice_edges = av_mallocz(ctb_count);
|
||||||
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
|
s->tab_slice_address = av_malloc_array(pic_size_in_ctb,
|
||||||
sizeof(*s->tab_slice_address));
|
sizeof(*s->tab_slice_address));
|
||||||
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
|
s->qp_y_tab = av_malloc_array(pic_size_in_ctb,
|
||||||
@ -144,7 +144,7 @@ static void pred_weight_table(HEVCContext *s, GetBitContext *gb)
|
|||||||
uint8_t luma_weight_l1_flag[16];
|
uint8_t luma_weight_l1_flag[16];
|
||||||
uint8_t chroma_weight_l1_flag[16];
|
uint8_t chroma_weight_l1_flag[16];
|
||||||
|
|
||||||
s->sh.luma_log2_weight_denom = get_ue_golomb_long(gb);
|
s->sh.luma_log2_weight_denom = av_clip_c(get_ue_golomb_long(gb), 0, 7);
|
||||||
if (s->sps->chroma_format_idc != 0) {
|
if (s->sps->chroma_format_idc != 0) {
|
||||||
int delta = get_se_golomb(gb);
|
int delta = get_se_golomb(gb);
|
||||||
s->sh.chroma_log2_weight_denom = av_clip(s->sh.luma_log2_weight_denom + delta, 0, 7);
|
s->sh.chroma_log2_weight_denom = av_clip(s->sh.luma_log2_weight_denom + delta, 0, 7);
|
||||||
@ -2870,17 +2870,30 @@ static int decode_nal_units(HEVCContext *s, const uint8_t *buf, int length)
|
|||||||
|
|
||||||
if (s->nals_allocated < s->nb_nals + 1) {
|
if (s->nals_allocated < s->nb_nals + 1) {
|
||||||
int new_size = s->nals_allocated + 1;
|
int new_size = s->nals_allocated + 1;
|
||||||
HEVCNAL *tmp = av_realloc_array(s->nals, new_size, sizeof(*tmp));
|
void *tmp = av_realloc_array(s->nals, new_size, sizeof(*s->nals));
|
||||||
|
ret = AVERROR(ENOMEM);
|
||||||
if (!tmp) {
|
if (!tmp) {
|
||||||
ret = AVERROR(ENOMEM);
|
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
s->nals = tmp;
|
s->nals = tmp;
|
||||||
memset(s->nals + s->nals_allocated, 0,
|
memset(s->nals + s->nals_allocated, 0,
|
||||||
(new_size - s->nals_allocated) * sizeof(*tmp));
|
(new_size - s->nals_allocated) * sizeof(*s->nals));
|
||||||
av_reallocp_array(&s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
|
|
||||||
av_reallocp_array(&s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
|
tmp = av_realloc_array(s->skipped_bytes_nal, new_size, sizeof(*s->skipped_bytes_nal));
|
||||||
av_reallocp_array(&s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
|
if (!tmp)
|
||||||
|
goto fail;
|
||||||
|
s->skipped_bytes_nal = tmp;
|
||||||
|
|
||||||
|
tmp = av_realloc_array(s->skipped_bytes_pos_size_nal, new_size, sizeof(*s->skipped_bytes_pos_size_nal));
|
||||||
|
if (!tmp)
|
||||||
|
goto fail;
|
||||||
|
s->skipped_bytes_pos_size_nal = tmp;
|
||||||
|
|
||||||
|
tmp = av_realloc_array(s->skipped_bytes_pos_nal, new_size, sizeof(*s->skipped_bytes_pos_nal));
|
||||||
|
if (!tmp)
|
||||||
|
goto fail;
|
||||||
|
s->skipped_bytes_pos_nal = tmp;
|
||||||
|
|
||||||
s->skipped_bytes_pos_size_nal[s->nals_allocated] = 1024; // initial buffer size
|
s->skipped_bytes_pos_size_nal[s->nals_allocated] = 1024; // initial buffer size
|
||||||
s->skipped_bytes_pos_nal[s->nals_allocated] = av_malloc_array(s->skipped_bytes_pos_size_nal[s->nals_allocated], sizeof(*s->skipped_bytes_pos));
|
s->skipped_bytes_pos_nal[s->nals_allocated] = av_malloc_array(s->skipped_bytes_pos_size_nal[s->nals_allocated], sizeof(*s->skipped_bytes_pos));
|
||||||
s->nals_allocated = new_size;
|
s->nals_allocated = new_size;
|
||||||
|
@ -1255,6 +1255,14 @@ int ff_hevc_decode_nal_pps(HEVCContext *s)
|
|||||||
if (pps->cu_qp_delta_enabled_flag)
|
if (pps->cu_qp_delta_enabled_flag)
|
||||||
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
|
pps->diff_cu_qp_delta_depth = get_ue_golomb_long(gb);
|
||||||
|
|
||||||
|
if (pps->diff_cu_qp_delta_depth < 0 ||
|
||||||
|
pps->diff_cu_qp_delta_depth > sps->log2_diff_max_min_coding_block_size) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "diff_cu_qp_delta_depth %d is invalid\n",
|
||||||
|
pps->diff_cu_qp_delta_depth);
|
||||||
|
ret = AVERROR_INVALIDDATA;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
pps->cb_qp_offset = get_se_golomb(gb);
|
pps->cb_qp_offset = get_se_golomb(gb);
|
||||||
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
|
if (pps->cb_qp_offset < -12 || pps->cb_qp_offset > 12) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
|
av_log(s->avctx, AV_LOG_ERROR, "pps_cb_qp_offset out of range: %d\n",
|
||||||
|
@ -94,7 +94,7 @@ typedef struct Indeo3DecodeContext {
|
|||||||
|
|
||||||
int16_t width, height;
|
int16_t width, height;
|
||||||
uint32_t frame_num; ///< current frame number (zero-based)
|
uint32_t frame_num; ///< current frame number (zero-based)
|
||||||
uint32_t data_size; ///< size of the frame data in bytes
|
int data_size; ///< size of the frame data in bytes
|
||||||
uint16_t frame_flags; ///< frame properties
|
uint16_t frame_flags; ///< frame properties
|
||||||
uint8_t cb_offset; ///< needed for selecting VQ tables
|
uint8_t cb_offset; ///< needed for selecting VQ tables
|
||||||
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
uint8_t buf_sel; ///< active frame buffer: 0 - primary, 1 -secondary
|
||||||
@ -899,7 +899,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
GetByteContext gb;
|
GetByteContext gb;
|
||||||
const uint8_t *bs_hdr;
|
const uint8_t *bs_hdr;
|
||||||
uint32_t frame_num, word2, check_sum, data_size;
|
uint32_t frame_num, word2, check_sum, data_size;
|
||||||
uint32_t y_offset, u_offset, v_offset, starts[3], ends[3];
|
int y_offset, u_offset, v_offset;
|
||||||
|
uint32_t starts[3], ends[3];
|
||||||
uint16_t height, width;
|
uint16_t height, width;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
@ -981,7 +982,8 @@ static int decode_frame_headers(Indeo3DecodeContext *ctx, AVCodecContext *avctx,
|
|||||||
ctx->y_data_size = ends[0] - starts[0];
|
ctx->y_data_size = ends[0] - starts[0];
|
||||||
ctx->v_data_size = ends[1] - starts[1];
|
ctx->v_data_size = ends[1] - starts[1];
|
||||||
ctx->u_data_size = ends[2] - starts[2];
|
ctx->u_data_size = ends[2] - starts[2];
|
||||||
if (FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
if (FFMIN3(y_offset, v_offset, u_offset) < 0 ||
|
||||||
|
FFMAX3(y_offset, v_offset, u_offset) >= ctx->data_size - 16 ||
|
||||||
FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
|
FFMIN3(y_offset, v_offset, u_offset) < gb.buffer - bs_hdr + 16 ||
|
||||||
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
FFMIN3(ctx->y_data_size, ctx->v_data_size, ctx->u_data_size) <= 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
av_log(avctx, AV_LOG_ERROR, "One of the y/u/v offsets is invalid\n");
|
||||||
|
@ -43,6 +43,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
|
|||||||
{
|
{
|
||||||
JvContext *s = avctx->priv_data;
|
JvContext *s = avctx->priv_data;
|
||||||
|
|
||||||
|
if (!avctx->width || !avctx->height ||
|
||||||
|
(avctx->width & 7) || (avctx->height & 7)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||||
|
avctx->width, avctx->height);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
s->frame = av_frame_alloc();
|
s->frame = av_frame_alloc();
|
||||||
if (!s->frame)
|
if (!s->frame)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
@ -561,9 +561,12 @@ unk_pixfmt:
|
|||||||
}
|
}
|
||||||
if (s->ls) {
|
if (s->ls) {
|
||||||
s->upscale_h = s->upscale_v = 0;
|
s->upscale_h = s->upscale_v = 0;
|
||||||
if (s->nb_components > 1)
|
if (s->nb_components == 3) {
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
s->avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
||||||
else if (s->palette_index && s->bits <= 8)
|
} else if (s->nb_components != 1) {
|
||||||
|
av_log(s->avctx, AV_LOG_ERROR, "Unsupported number of components %d\n", s->nb_components);
|
||||||
|
return AVERROR_PATCHWELCOME;
|
||||||
|
} else if (s->palette_index && s->bits <= 8)
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
s->avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
else if (s->bits <= 8)
|
else if (s->bits <= 8)
|
||||||
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
s->avctx->pix_fmt = AV_PIX_FMT_GRAY8;
|
||||||
@ -1248,13 +1251,18 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
|||||||
|
|
||||||
if (s->interlaced && s->bottom_field)
|
if (s->interlaced && s->bottom_field)
|
||||||
block_offset += linesize[c] >> 1;
|
block_offset += linesize[c] >> 1;
|
||||||
ptr = data[c] + block_offset;
|
if ( 8*(h * mb_x + x) < s->width
|
||||||
|
&& 8*(v * mb_y + y) < s->height) {
|
||||||
|
ptr = data[c] + block_offset;
|
||||||
|
} else
|
||||||
|
ptr = NULL;
|
||||||
if (!s->progressive) {
|
if (!s->progressive) {
|
||||||
if (copy_mb)
|
if (copy_mb) {
|
||||||
mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
|
if (ptr)
|
||||||
linesize[c], s->avctx->lowres);
|
mjpeg_copy_block(s, ptr, reference_data[c] + block_offset,
|
||||||
|
linesize[c], s->avctx->lowres);
|
||||||
|
|
||||||
else {
|
} else {
|
||||||
s->bdsp.clear_block(s->block);
|
s->bdsp.clear_block(s->block);
|
||||||
if (decode_block(s, s->block, i,
|
if (decode_block(s, s->block, i,
|
||||||
s->dc_index[i], s->ac_index[i],
|
s->dc_index[i], s->ac_index[i],
|
||||||
@ -1263,9 +1271,11 @@ static int mjpeg_decode_scan(MJpegDecodeContext *s, int nb_components, int Ah,
|
|||||||
"error y=%d x=%d\n", mb_y, mb_x);
|
"error y=%d x=%d\n", mb_y, mb_x);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
s->idsp.idct_put(ptr, linesize[c], s->block);
|
if (ptr) {
|
||||||
if (s->bits & 7)
|
s->idsp.idct_put(ptr, linesize[c], s->block);
|
||||||
shift_output(s, ptr, linesize[c]);
|
if (s->bits & 7)
|
||||||
|
shift_output(s, ptr, linesize[c]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
int block_idx = s->block_stride[c] * (v * mb_y + y) +
|
int block_idx = s->block_stride[c] * (v * mb_y + y) +
|
||||||
@ -1904,6 +1914,10 @@ int ff_mjpeg_find_marker(MJpegDecodeContext *s,
|
|||||||
put_bits(&pb, 8, x);
|
put_bits(&pb, 8, x);
|
||||||
if (x == 0xFF) {
|
if (x == 0xFF) {
|
||||||
x = src[b++];
|
x = src[b++];
|
||||||
|
if (x & 0x80) {
|
||||||
|
av_log(s->avctx, AV_LOG_WARNING, "Invalid escape sequence\n");
|
||||||
|
x &= 0x7f;
|
||||||
|
}
|
||||||
put_bits(&pb, 7, x);
|
put_bits(&pb, 7, x);
|
||||||
bit_count--;
|
bit_count--;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,13 @@ static av_cold int mm_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
avctx->pix_fmt = AV_PIX_FMT_PAL8;
|
||||||
|
|
||||||
|
if (!avctx->width || !avctx->height ||
|
||||||
|
(avctx->width & 1) || (avctx->height & 1)) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "Invalid video dimensions: %dx%d\n",
|
||||||
|
avctx->width, avctx->height);
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
}
|
||||||
|
|
||||||
s->frame = av_frame_alloc();
|
s->frame = av_frame_alloc();
|
||||||
if (!s->frame)
|
if (!s->frame)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
@ -428,9 +428,11 @@ static av_cold int decode_init(AVCodecContext * avctx)
|
|||||||
|
|
||||||
s->avctx = avctx;
|
s->avctx = avctx;
|
||||||
|
|
||||||
|
#if USE_FLOATS
|
||||||
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
s->fdsp = avpriv_float_dsp_alloc(avctx->flags & CODEC_FLAG_BITEXACT);
|
||||||
if (!s->fdsp)
|
if (!s->fdsp)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
#endif
|
||||||
|
|
||||||
ff_mpadsp_init(&s->mpadsp);
|
ff_mpadsp_init(&s->mpadsp);
|
||||||
|
|
||||||
|
@ -395,18 +395,18 @@ av_cold int ff_mpv_encode_init(AVCodecContext *avctx)
|
|||||||
switch(avctx->codec_id) {
|
switch(avctx->codec_id) {
|
||||||
case AV_CODEC_ID_MPEG1VIDEO:
|
case AV_CODEC_ID_MPEG1VIDEO:
|
||||||
case AV_CODEC_ID_MPEG2VIDEO:
|
case AV_CODEC_ID_MPEG2VIDEO:
|
||||||
avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112L / 15000000 * 16384;
|
avctx->rc_buffer_size = FFMAX(avctx->rc_max_rate, 15000000) * 112LL / 15000000 * 16384;
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_MPEG4:
|
case AV_CODEC_ID_MPEG4:
|
||||||
case AV_CODEC_ID_MSMPEG4V1:
|
case AV_CODEC_ID_MSMPEG4V1:
|
||||||
case AV_CODEC_ID_MSMPEG4V2:
|
case AV_CODEC_ID_MSMPEG4V2:
|
||||||
case AV_CODEC_ID_MSMPEG4V3:
|
case AV_CODEC_ID_MSMPEG4V3:
|
||||||
if (avctx->rc_max_rate >= 15000000) {
|
if (avctx->rc_max_rate >= 15000000) {
|
||||||
avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000L) * (760-320) / (38400000 - 15000000);
|
avctx->rc_buffer_size = 320 + (avctx->rc_max_rate - 15000000LL) * (760-320) / (38400000 - 15000000);
|
||||||
} else if(avctx->rc_max_rate >= 2000000) {
|
} else if(avctx->rc_max_rate >= 2000000) {
|
||||||
avctx->rc_buffer_size = 80 + (avctx->rc_max_rate - 2000000L) * (320- 80) / (15000000 - 2000000);
|
avctx->rc_buffer_size = 80 + (avctx->rc_max_rate - 2000000LL) * (320- 80) / (15000000 - 2000000);
|
||||||
} else if(avctx->rc_max_rate >= 384000) {
|
} else if(avctx->rc_max_rate >= 384000) {
|
||||||
avctx->rc_buffer_size = 40 + (avctx->rc_max_rate - 384000L) * ( 80- 40) / ( 2000000 - 384000);
|
avctx->rc_buffer_size = 40 + (avctx->rc_max_rate - 384000LL) * ( 80- 40) / ( 2000000 - 384000);
|
||||||
} else
|
} else
|
||||||
avctx->rc_buffer_size = 40;
|
avctx->rc_buffer_size = 40;
|
||||||
avctx->rc_buffer_size *= 16384;
|
avctx->rc_buffer_size *= 16384;
|
||||||
|
@ -178,7 +178,7 @@ static void gmc_motion(MpegEncContext *s,
|
|||||||
s->sprite_delta[0][0], s->sprite_delta[0][1],
|
s->sprite_delta[0][0], s->sprite_delta[0][1],
|
||||||
s->sprite_delta[1][0], s->sprite_delta[1][1],
|
s->sprite_delta[1][0], s->sprite_delta[1][1],
|
||||||
a + 1, (1 << (2 * a + 1)) - s->no_rounding,
|
a + 1, (1 << (2 * a + 1)) - s->no_rounding,
|
||||||
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
|
(s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1);
|
||||||
|
|
||||||
ptr = ref_picture[2];
|
ptr = ref_picture[2];
|
||||||
s->mdsp.gmc(dest_cr, ptr, uvlinesize, 8,
|
s->mdsp.gmc(dest_cr, ptr, uvlinesize, 8,
|
||||||
@ -186,7 +186,7 @@ static void gmc_motion(MpegEncContext *s,
|
|||||||
s->sprite_delta[0][0], s->sprite_delta[0][1],
|
s->sprite_delta[0][0], s->sprite_delta[0][1],
|
||||||
s->sprite_delta[1][0], s->sprite_delta[1][1],
|
s->sprite_delta[1][0], s->sprite_delta[1][1],
|
||||||
a + 1, (1 << (2 * a + 1)) - s->no_rounding,
|
a + 1, (1 << (2 * a + 1)) - s->no_rounding,
|
||||||
s->h_edge_pos >> 1, s->v_edge_pos >> 1);
|
(s->h_edge_pos + 1) >> 1, (s->v_edge_pos + 1) >> 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline int hpel_motion(MpegEncContext *s,
|
static inline int hpel_motion(MpegEncContext *s,
|
||||||
|
@ -209,16 +209,26 @@ static void idct_add_altivec(uint8_t *dest, int stride, int16_t *blk)
|
|||||||
|
|
||||||
IDCT;
|
IDCT;
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
p0 = vec_lvsl(0, dest);
|
p0 = vec_lvsl(0, dest);
|
||||||
p1 = vec_lvsl(stride, dest);
|
p1 = vec_lvsl(stride, dest);
|
||||||
p = vec_splat_u8(-1);
|
p = vec_splat_u8(-1);
|
||||||
perm0 = vec_mergeh(p, p0);
|
perm0 = vec_mergeh(p, p0);
|
||||||
perm1 = vec_mergeh(p, p1);
|
perm1 = vec_mergeh(p, p1);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
|
#define GET_TMP2(dest, prm) \
|
||||||
|
tmp = vec_ld(0, dest); \
|
||||||
|
tmp2 = (vec_s16) vec_perm(tmp, (vec_u8) zero, prm);
|
||||||
|
#else
|
||||||
|
#define GET_TMP2(dest, prm) \
|
||||||
|
tmp = vec_vsx_ld(0, dest); \
|
||||||
|
tmp2 = (vec_s16) vec_mergeh(tmp, (vec_u8) zero)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ADD(dest, src, perm) \
|
#define ADD(dest, src, perm) \
|
||||||
/* *(uint64_t *) &tmp = *(uint64_t *) dest; */ \
|
GET_TMP2(dest, perm); \
|
||||||
tmp = vec_ld(0, dest); \
|
|
||||||
tmp2 = (vec_s16) vec_perm(tmp, (vec_u8) zero, perm); \
|
|
||||||
tmp3 = vec_adds(tmp2, src); \
|
tmp3 = vec_adds(tmp2, src); \
|
||||||
tmp = vec_packsu(tmp3, tmp3); \
|
tmp = vec_packsu(tmp3, tmp3); \
|
||||||
vec_ste((vec_u32) tmp, 0, (unsigned int *) dest); \
|
vec_ste((vec_u32) tmp, 0, (unsigned int *) dest); \
|
||||||
|
@ -55,7 +55,7 @@ static int pix_norm1_altivec(uint8_t *pix, int line_size)
|
|||||||
/* Sum up the four partial sums, and put the result into s. */
|
/* Sum up the four partial sums, and put the result into s. */
|
||||||
sum = vec_sums((vector signed int) sv, (vector signed int) zero);
|
sum = vec_sums((vector signed int) sv, (vector signed int) zero);
|
||||||
sum = vec_splat(sum, 3);
|
sum = vec_splat(sum, 3);
|
||||||
vec_vsx_st(sum, 0, &s);
|
vec_ste(sum, 0, &s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -113,7 +113,7 @@ static int pix_sum_altivec(uint8_t *pix, int line_size)
|
|||||||
/* Sum up the four partial sums, and put the result into s. */
|
/* Sum up the four partial sums, and put the result into s. */
|
||||||
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
|
sumdiffs = vec_sums((vector signed int) sad, (vector signed int) zero);
|
||||||
sumdiffs = vec_splat(sumdiffs, 3);
|
sumdiffs = vec_splat(sumdiffs, 3);
|
||||||
vec_vsx_st(sumdiffs, 0, &s);
|
vec_ste(sumdiffs, 0, &s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -304,16 +304,23 @@ static void vc1_inv_trans_8x4_altivec(uint8_t *dest, int stride, int16_t *block)
|
|||||||
src2 = vec_pack(s2, sA);
|
src2 = vec_pack(s2, sA);
|
||||||
src3 = vec_pack(s3, sB);
|
src3 = vec_pack(s3, sB);
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
p0 = vec_lvsl (0, dest);
|
p0 = vec_lvsl (0, dest);
|
||||||
p1 = vec_lvsl (stride, dest);
|
p1 = vec_lvsl (stride, dest);
|
||||||
p = vec_splat_u8 (-1);
|
p = vec_splat_u8 (-1);
|
||||||
perm0 = vec_mergeh (p, p0);
|
perm0 = vec_mergeh (p, p0);
|
||||||
perm1 = vec_mergeh (p, p1);
|
perm1 = vec_mergeh (p, p1);
|
||||||
|
#define GET_TMP2(dst, p) \
|
||||||
|
tmp = vec_ld (0, dest); \
|
||||||
|
tmp2 = (vector signed short)vec_perm (tmp, vec_splat_u8(0), p);
|
||||||
|
#else
|
||||||
|
#define GET_TMP2(dst,p) \
|
||||||
|
tmp = vec_vsx_ld (0, dst); \
|
||||||
|
tmp2 = (vector signed short)vec_mergeh (tmp, vec_splat_u8(0));
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ADD(dest,src,perm) \
|
#define ADD(dest,src,perm) \
|
||||||
/* *(uint64_t *)&tmp = *(uint64_t *)dest; */ \
|
GET_TMP2(dest, perm); \
|
||||||
tmp = vec_ld (0, dest); \
|
|
||||||
tmp2 = (vector signed short)vec_perm (tmp, vec_splat_u8(0), perm); \
|
|
||||||
tmp3 = vec_adds (tmp2, src); \
|
tmp3 = vec_adds (tmp2, src); \
|
||||||
tmp = vec_packsu (tmp3, tmp3); \
|
tmp = vec_packsu (tmp3, tmp3); \
|
||||||
vec_ste ((vector unsigned int)tmp, 0, (unsigned int *)dest); \
|
vec_ste ((vector unsigned int)tmp, 0, (unsigned int *)dest); \
|
||||||
|
@ -32,8 +32,13 @@
|
|||||||
|
|
||||||
static const vec_s16 constants =
|
static const vec_s16 constants =
|
||||||
{0, 64277, 60547, 54491, 46341, 36410, 25080, 12785};
|
{0, 64277, 60547, 54491, 46341, 36410, 25080, 12785};
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
static const vec_u8 interleave_high =
|
static const vec_u8 interleave_high =
|
||||||
{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29};
|
{0, 1, 16, 17, 4, 5, 20, 21, 8, 9, 24, 25, 12, 13, 28, 29};
|
||||||
|
#else
|
||||||
|
static const vec_u8 interleave_high =
|
||||||
|
{2, 3, 18, 19, 6, 7, 22, 23, 10, 11, 26, 27, 14, 15, 30, 31};
|
||||||
|
#endif
|
||||||
|
|
||||||
#define IDCT_START \
|
#define IDCT_START \
|
||||||
vec_s16 A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;\
|
vec_s16 A, B, C, D, Ad, Bd, Cd, Dd, E, F, G, H;\
|
||||||
@ -156,9 +161,18 @@ static void vp3_idct_add_altivec(uint8_t *dst, int stride, int16_t block[64])
|
|||||||
TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
|
TRANSPOSE8(b0, b1, b2, b3, b4, b5, b6, b7);
|
||||||
IDCT_1D(ADD8, SHIFT4)
|
IDCT_1D(ADD8, SHIFT4)
|
||||||
|
|
||||||
#define ADD(a)\
|
#if HAVE_BIGENDIAN
|
||||||
|
#define GET_VDST16\
|
||||||
vdst = vec_ld(0, dst);\
|
vdst = vec_ld(0, dst);\
|
||||||
vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);\
|
vdst_16 = (vec_s16)vec_perm(vdst, zero_u8v, vdst_mask);
|
||||||
|
#else
|
||||||
|
#define GET_VDST16\
|
||||||
|
vdst = vec_vsx_ld(0,dst);\
|
||||||
|
vdst_16 = (vec_s16)vec_mergeh(vdst, zero_u8v);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define ADD(a)\
|
||||||
|
GET_VDST16;\
|
||||||
vdst_16 = vec_adds(a, vdst_16);\
|
vdst_16 = vec_adds(a, vdst_16);\
|
||||||
t = vec_packsu(vdst_16, vdst_16);\
|
t = vec_packsu(vdst_16, vdst_16);\
|
||||||
vec_ste((vec_u32)t, 0, (unsigned int *)dst);\
|
vec_ste((vec_u32)t, 0, (unsigned int *)dst);\
|
||||||
|
@ -59,17 +59,30 @@ static const vec_s8 h_subpel_filters_outer[3] =
|
|||||||
vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \
|
vec_s8 filter_outerh = h_subpel_filters_outer[(i)>>1]; \
|
||||||
vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2)
|
vec_s8 filter_outerl = vec_sld(filter_outerh, filter_outerh, 2)
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
|
#define GET_PIXHL(offset) \
|
||||||
|
a = vec_ld((offset)-is6tap-1, src); \
|
||||||
|
b = vec_ld((offset)-is6tap-1+15, src); \
|
||||||
|
pixh = vec_perm(a, b, permh##offset); \
|
||||||
|
pixl = vec_perm(a, b, perml##offset)
|
||||||
|
|
||||||
|
#define GET_OUTER(offset) outer = vec_perm(a, b, perm_6tap##offset)
|
||||||
|
#else
|
||||||
|
#define GET_PIXHL(offset) \
|
||||||
|
a = vec_vsx_ld((offset)-is6tap-1, src); \
|
||||||
|
pixh = vec_perm(a, a, perm_inner); \
|
||||||
|
pixl = vec_perm(a, a, vec_add(perm_inner, vec_splat_u8(4)))
|
||||||
|
|
||||||
|
#define GET_OUTER(offset) outer = vec_perm(a, a, perm_outer)
|
||||||
|
#endif
|
||||||
|
|
||||||
#define FILTER_H(dstv, off) \
|
#define FILTER_H(dstv, off) \
|
||||||
a = vec_ld((off)-is6tap-1, src); \
|
GET_PIXHL(off); \
|
||||||
b = vec_ld((off)-is6tap-1+15, src); \
|
|
||||||
\
|
|
||||||
pixh = vec_perm(a, b, permh##off); \
|
|
||||||
pixl = vec_perm(a, b, perml##off); \
|
|
||||||
filth = vec_msum(filter_inner, pixh, c64); \
|
filth = vec_msum(filter_inner, pixh, c64); \
|
||||||
filtl = vec_msum(filter_inner, pixl, c64); \
|
filtl = vec_msum(filter_inner, pixl, c64); \
|
||||||
\
|
\
|
||||||
if (is6tap) { \
|
if (is6tap) { \
|
||||||
outer = vec_perm(a, b, perm_6tap##off); \
|
GET_OUTER(off); \
|
||||||
filth = vec_msum(filter_outerh, outer, filth); \
|
filth = vec_msum(filter_outerh, outer, filth); \
|
||||||
filtl = vec_msum(filter_outerl, outer, filtl); \
|
filtl = vec_msum(filter_outerl, outer, filtl); \
|
||||||
} \
|
} \
|
||||||
@ -84,9 +97,12 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
|||||||
int h, int mx, int w, int is6tap)
|
int h, int mx, int w, int is6tap)
|
||||||
{
|
{
|
||||||
LOAD_H_SUBPEL_FILTER(mx-1);
|
LOAD_H_SUBPEL_FILTER(mx-1);
|
||||||
vec_u8 align_vec0, align_vec8, permh0, permh8, filt;
|
#if HAVE_BIGENDIAN
|
||||||
|
vec_u8 align_vec0, align_vec8, permh0, permh8;
|
||||||
vec_u8 perm_6tap0, perm_6tap8, perml0, perml8;
|
vec_u8 perm_6tap0, perm_6tap8, perml0, perml8;
|
||||||
vec_u8 a, b, pixh, pixl, outer;
|
vec_u8 b;
|
||||||
|
#endif
|
||||||
|
vec_u8 filt, a, pixh, pixl, outer;
|
||||||
vec_s16 f16h, f16l;
|
vec_s16 f16h, f16l;
|
||||||
vec_s32 filth, filtl;
|
vec_s32 filth, filtl;
|
||||||
|
|
||||||
@ -97,6 +113,7 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
|||||||
vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6));
|
vec_s32 c64 = vec_sl(vec_splat_s32(1), vec_splat_u32(6));
|
||||||
vec_u16 c7 = vec_splat_u16(7);
|
vec_u16 c7 = vec_splat_u16(7);
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
align_vec0 = vec_lvsl( -is6tap-1, src);
|
align_vec0 = vec_lvsl( -is6tap-1, src);
|
||||||
align_vec8 = vec_lvsl(8-is6tap-1, src);
|
align_vec8 = vec_lvsl(8-is6tap-1, src);
|
||||||
|
|
||||||
@ -107,6 +124,7 @@ void put_vp8_epel_h_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
|||||||
perml8 = vec_perm(align_vec8, align_vec8, perm_inner);
|
perml8 = vec_perm(align_vec8, align_vec8, perm_inner);
|
||||||
perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer);
|
perm_6tap0 = vec_perm(align_vec0, align_vec0, perm_outer);
|
||||||
perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer);
|
perm_6tap8 = vec_perm(align_vec8, align_vec8, perm_outer);
|
||||||
|
#endif
|
||||||
|
|
||||||
while (h --> 0) {
|
while (h --> 0) {
|
||||||
FILTER_H(f16h, 0);
|
FILTER_H(f16h, 0);
|
||||||
@ -164,6 +182,12 @@ static const vec_u8 v_subpel_filters[7] =
|
|||||||
dstv = vec_adds(dstv, c64); \
|
dstv = vec_adds(dstv, c64); \
|
||||||
dstv = vec_sra(dstv, c7)
|
dstv = vec_sra(dstv, c7)
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
|
#define LOAD_HL(off, s, perm) load_with_perm_vec(off, s, perm)
|
||||||
|
#else
|
||||||
|
#define LOAD_HL(off, s, perm) vec_mergeh(vec_vsx_ld(off,s), vec_vsx_ld(off+8,s))
|
||||||
|
#endif
|
||||||
|
|
||||||
static av_always_inline
|
static av_always_inline
|
||||||
void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
||||||
uint8_t *src, ptrdiff_t src_stride,
|
uint8_t *src, ptrdiff_t src_stride,
|
||||||
@ -175,6 +199,7 @@ void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
|||||||
vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6));
|
vec_s16 c64 = vec_sl(vec_splat_s16(1), vec_splat_u16(6));
|
||||||
vec_u16 c7 = vec_splat_u16(7);
|
vec_u16 c7 = vec_splat_u16(7);
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
// we want pixels 0-7 to be in the even positions and 8-15 in the odd,
|
// we want pixels 0-7 to be in the even positions and 8-15 in the odd,
|
||||||
// so combine this permute with the alignment permute vector
|
// so combine this permute with the alignment permute vector
|
||||||
align_vech = vec_lvsl(0, src);
|
align_vech = vec_lvsl(0, src);
|
||||||
@ -183,22 +208,23 @@ void put_vp8_epel_v_altivec_core(uint8_t *dst, ptrdiff_t dst_stride,
|
|||||||
perm_vec = vec_mergeh(align_vech, align_vecl);
|
perm_vec = vec_mergeh(align_vech, align_vecl);
|
||||||
else
|
else
|
||||||
perm_vec = vec_mergeh(align_vech, align_vech);
|
perm_vec = vec_mergeh(align_vech, align_vech);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (is6tap)
|
if (is6tap)
|
||||||
s0 = load_with_perm_vec(-2*src_stride, src, perm_vec);
|
s0 = LOAD_HL(-2*src_stride, src, perm_vec);
|
||||||
s1 = load_with_perm_vec(-1*src_stride, src, perm_vec);
|
s1 = LOAD_HL(-1*src_stride, src, perm_vec);
|
||||||
s2 = load_with_perm_vec( 0*src_stride, src, perm_vec);
|
s2 = LOAD_HL( 0*src_stride, src, perm_vec);
|
||||||
s3 = load_with_perm_vec( 1*src_stride, src, perm_vec);
|
s3 = LOAD_HL( 1*src_stride, src, perm_vec);
|
||||||
if (is6tap)
|
if (is6tap)
|
||||||
s4 = load_with_perm_vec( 2*src_stride, src, perm_vec);
|
s4 = LOAD_HL( 2*src_stride, src, perm_vec);
|
||||||
|
|
||||||
src += (2+is6tap)*src_stride;
|
src += (2+is6tap)*src_stride;
|
||||||
|
|
||||||
while (h --> 0) {
|
while (h --> 0) {
|
||||||
if (is6tap)
|
if (is6tap)
|
||||||
s5 = load_with_perm_vec(0, src, perm_vec);
|
s5 = LOAD_HL(0, src, perm_vec);
|
||||||
else
|
else
|
||||||
s4 = load_with_perm_vec(0, src, perm_vec);
|
s4 = LOAD_HL(0, src, perm_vec);
|
||||||
|
|
||||||
FILTER_V(f16h, vec_mule);
|
FILTER_V(f16h, vec_mule);
|
||||||
|
|
||||||
@ -272,39 +298,25 @@ EPEL_HV(4, 4,4)
|
|||||||
|
|
||||||
static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
|
static void put_vp8_pixels16_altivec(uint8_t *dst, ptrdiff_t dstride, uint8_t *src, ptrdiff_t sstride, int h, int mx, int my)
|
||||||
{
|
{
|
||||||
register vector unsigned char pixelsv1, pixelsv2;
|
register vector unsigned char perm;
|
||||||
register vector unsigned char pixelsv1B, pixelsv2B;
|
|
||||||
register vector unsigned char pixelsv1C, pixelsv2C;
|
|
||||||
register vector unsigned char pixelsv1D, pixelsv2D;
|
|
||||||
|
|
||||||
register vector unsigned char perm = vec_lvsl(0, src);
|
|
||||||
int i;
|
int i;
|
||||||
register ptrdiff_t dstride2 = dstride << 1, sstride2 = sstride << 1;
|
register ptrdiff_t dstride2 = dstride << 1, sstride2 = sstride << 1;
|
||||||
register ptrdiff_t dstride3 = dstride2 + dstride, sstride3 = sstride + sstride2;
|
register ptrdiff_t dstride3 = dstride2 + dstride, sstride3 = sstride + sstride2;
|
||||||
register ptrdiff_t dstride4 = dstride << 2, sstride4 = sstride << 2;
|
register ptrdiff_t dstride4 = dstride << 2, sstride4 = sstride << 2;
|
||||||
|
|
||||||
|
#if HAVE_BIGENDIAN
|
||||||
|
perm = vec_lvsl(0, src);
|
||||||
|
#endif
|
||||||
// hand-unrolling the loop by 4 gains about 15%
|
// hand-unrolling the loop by 4 gains about 15%
|
||||||
// mininum execution time goes from 74 to 60 cycles
|
// mininum execution time goes from 74 to 60 cycles
|
||||||
// it's faster than -funroll-loops, but using
|
// it's faster than -funroll-loops, but using
|
||||||
// -funroll-loops w/ this is bad - 74 cycles again.
|
// -funroll-loops w/ this is bad - 74 cycles again.
|
||||||
// all this is on a 7450, tuning for the 7450
|
// all this is on a 7450, tuning for the 7450
|
||||||
for (i = 0; i < h; i += 4) {
|
for (i = 0; i < h; i += 4) {
|
||||||
pixelsv1 = vec_ld( 0, src);
|
vec_st(load_with_perm_vec(0, src, perm), 0, dst);
|
||||||
pixelsv2 = vec_ld(15, src);
|
vec_st(load_with_perm_vec(sstride, src, perm), dstride, dst);
|
||||||
pixelsv1B = vec_ld(sstride, src);
|
vec_st(load_with_perm_vec(sstride2, src, perm), dstride2, dst);
|
||||||
pixelsv2B = vec_ld(15 + sstride, src);
|
vec_st(load_with_perm_vec(sstride3, src, perm), dstride3, dst);
|
||||||
pixelsv1C = vec_ld(sstride2, src);
|
|
||||||
pixelsv2C = vec_ld(15 + sstride2, src);
|
|
||||||
pixelsv1D = vec_ld(sstride3, src);
|
|
||||||
pixelsv2D = vec_ld(15 + sstride3, src);
|
|
||||||
vec_st(vec_perm(pixelsv1, pixelsv2, perm),
|
|
||||||
0, (unsigned char*)dst);
|
|
||||||
vec_st(vec_perm(pixelsv1B, pixelsv2B, perm),
|
|
||||||
dstride, (unsigned char*)dst);
|
|
||||||
vec_st(vec_perm(pixelsv1C, pixelsv2C, perm),
|
|
||||||
dstride2, (unsigned char*)dst);
|
|
||||||
vec_st(vec_perm(pixelsv1D, pixelsv2D, perm),
|
|
||||||
dstride3, (unsigned char*)dst);
|
|
||||||
src += sstride4;
|
src += sstride4;
|
||||||
dst += dstride4;
|
dst += dstride4;
|
||||||
}
|
}
|
||||||
|
@ -120,12 +120,13 @@ static void av_noinline qpeg_decode_inter(QpegContext *qctx, uint8_t *dst,
|
|||||||
int filled = 0;
|
int filled = 0;
|
||||||
int orig_height;
|
int orig_height;
|
||||||
|
|
||||||
if(!refdata)
|
if (refdata) {
|
||||||
refdata= dst;
|
/* copy prev frame */
|
||||||
|
for (i = 0; i < height; i++)
|
||||||
/* copy prev frame */
|
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
||||||
for(i = 0; i < height; i++)
|
} else {
|
||||||
memcpy(dst + (i * stride), refdata + (i * stride), width);
|
refdata = dst;
|
||||||
|
}
|
||||||
|
|
||||||
orig_height = height;
|
orig_height = height;
|
||||||
height--;
|
height--;
|
||||||
|
@ -66,6 +66,9 @@
|
|||||||
#include "compat/os2threads.h"
|
#include "compat/os2threads.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_codec_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
#if HAVE_PTHREADS || HAVE_W32THREADS || HAVE_OS2THREADS
|
||||||
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
|
static int default_lockmgr_cb(void **arg, enum AVLockOp op)
|
||||||
{
|
{
|
||||||
|
@ -215,6 +215,8 @@ static void restore_median(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
|
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
// first line - left neighbour prediction
|
// first line - left neighbour prediction
|
||||||
@ -270,6 +272,8 @@ static void restore_median_il(uint8_t *src, int step, int stride,
|
|||||||
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
slice_height = ((((slice + 1) * height) / slices) & cmask) -
|
||||||
slice_start;
|
slice_start;
|
||||||
slice_height >>= 1;
|
slice_height >>= 1;
|
||||||
|
if (!slice_height)
|
||||||
|
continue;
|
||||||
|
|
||||||
bsrc = src + slice_start * stride;
|
bsrc = src + slice_start * stride;
|
||||||
|
|
||||||
|
@ -339,6 +339,9 @@ static int vmd_decode(VmdVideoContext *s, AVFrame *frame)
|
|||||||
ofs += slen;
|
ofs += slen;
|
||||||
bytestream2_skip(&gb, len);
|
bytestream2_skip(&gb, len);
|
||||||
} else {
|
} else {
|
||||||
|
if (ofs + len > frame_width ||
|
||||||
|
bytestream2_get_bytes_left(&gb) < len)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
bytestream2_get_buffer(&gb, &dp[ofs], len);
|
bytestream2_get_buffer(&gb, &dp[ofs], len);
|
||||||
ofs += len;
|
ofs += len;
|
||||||
}
|
}
|
||||||
|
@ -176,19 +176,25 @@ int update_dimensions(VP8Context *s, int width, int height, int is_vp7)
|
|||||||
s->top_border = av_mallocz((s->mb_width + 1) * sizeof(*s->top_border));
|
s->top_border = av_mallocz((s->mb_width + 1) * sizeof(*s->top_border));
|
||||||
s->thread_data = av_mallocz(MAX_THREADS * sizeof(VP8ThreadData));
|
s->thread_data = av_mallocz(MAX_THREADS * sizeof(VP8ThreadData));
|
||||||
|
|
||||||
|
if (!s->macroblocks_base || !s->top_nnz || !s->top_border ||
|
||||||
|
!s->thread_data || (!s->intra4x4_pred_mode_top && !s->mb_layout)) {
|
||||||
|
free_buffers(s);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAX_THREADS; i++) {
|
for (i = 0; i < MAX_THREADS; i++) {
|
||||||
s->thread_data[i].filter_strength =
|
s->thread_data[i].filter_strength =
|
||||||
av_mallocz(s->mb_width * sizeof(*s->thread_data[0].filter_strength));
|
av_mallocz(s->mb_width * sizeof(*s->thread_data[0].filter_strength));
|
||||||
|
if (!s->thread_data[i].filter_strength) {
|
||||||
|
free_buffers(s);
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
}
|
||||||
#if HAVE_THREADS
|
#if HAVE_THREADS
|
||||||
pthread_mutex_init(&s->thread_data[i].lock, NULL);
|
pthread_mutex_init(&s->thread_data[i].lock, NULL);
|
||||||
pthread_cond_init(&s->thread_data[i].cond, NULL);
|
pthread_cond_init(&s->thread_data[i].cond, NULL);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!s->macroblocks_base || !s->top_nnz || !s->top_border ||
|
|
||||||
(!s->intra4x4_pred_mode_top && !s->mb_layout))
|
|
||||||
return AVERROR(ENOMEM);
|
|
||||||
|
|
||||||
s->macroblocks = s->macroblocks_base + 1;
|
s->macroblocks = s->macroblocks_base + 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -77,6 +77,8 @@ static int parse(AVCodecParserContext *ctx,
|
|||||||
idx += a; \
|
idx += a; \
|
||||||
if (sz > size) { \
|
if (sz > size) { \
|
||||||
s->n_frames = 0; \
|
s->n_frames = 0; \
|
||||||
|
*out_size = 0; \
|
||||||
|
*out_data = data; \
|
||||||
av_log(avctx, AV_LOG_ERROR, \
|
av_log(avctx, AV_LOG_ERROR, \
|
||||||
"Superframe packet size too big: %u > %d\n", \
|
"Superframe packet size too big: %u > %d\n", \
|
||||||
sz, size); \
|
sz, size); \
|
||||||
|
@ -26,12 +26,6 @@ SECTION_TEXT
|
|||||||
; int ff_scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3,
|
; int ff_scalarproduct_and_madd_int16(int16_t *v1, int16_t *v2, int16_t *v3,
|
||||||
; int order, int mul)
|
; int order, int mul)
|
||||||
cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
|
cglobal scalarproduct_and_madd_int16, 4,4,8, v1, v2, v3, order, mul
|
||||||
%if mmsize == 16
|
|
||||||
test orderq, 8
|
|
||||||
jnz scalarproduct_and_madd_int16_fallback
|
|
||||||
%else
|
|
||||||
scalarproduct_and_madd_int16_fallback
|
|
||||||
%endif
|
|
||||||
shl orderq, 1
|
shl orderq, 1
|
||||||
movd m7, mulm
|
movd m7, mulm
|
||||||
%if mmsize == 16
|
%if mmsize == 16
|
||||||
@ -123,8 +117,6 @@ align 16
|
|||||||
; int order, int mul)
|
; int order, int mul)
|
||||||
INIT_XMM ssse3
|
INIT_XMM ssse3
|
||||||
cglobal scalarproduct_and_madd_int16, 4,5,10, v1, v2, v3, order, mul
|
cglobal scalarproduct_and_madd_int16, 4,5,10, v1, v2, v3, order, mul
|
||||||
test orderq, 8
|
|
||||||
jnz scalarproduct_and_madd_int16_fallback
|
|
||||||
shl orderq, 1
|
shl orderq, 1
|
||||||
movd m7, mulm
|
movd m7, mulm
|
||||||
pshuflw m7, m7, 0
|
pshuflw m7, m7, 0
|
||||||
|
@ -31,17 +31,41 @@ int32_t ff_scalarproduct_and_madd_int16_ssse3(int16_t *v1, const int16_t *v2,
|
|||||||
const int16_t *v3,
|
const int16_t *v3,
|
||||||
int order, int mul);
|
int order, int mul);
|
||||||
|
|
||||||
|
#if HAVE_YASM
|
||||||
|
static int32_t scalarproduct_and_madd_int16_sse2(int16_t *v1, const int16_t *v2,
|
||||||
|
const int16_t *v3,
|
||||||
|
int order, int mul)
|
||||||
|
{
|
||||||
|
if (order & 8)
|
||||||
|
return ff_scalarproduct_and_madd_int16_mmxext(v1, v2, v3, order, mul);
|
||||||
|
else
|
||||||
|
return ff_scalarproduct_and_madd_int16_sse2(v1, v2, v3, order, mul);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int32_t scalarproduct_and_madd_int16_ssse3(int16_t *v1, const int16_t *v2,
|
||||||
|
const int16_t *v3,
|
||||||
|
int order, int mul)
|
||||||
|
{
|
||||||
|
if (order & 8)
|
||||||
|
return ff_scalarproduct_and_madd_int16_mmxext(v1, v2, v3, order, mul);
|
||||||
|
else
|
||||||
|
return ff_scalarproduct_and_madd_int16_ssse3(v1, v2, v3, order, mul);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
av_cold void ff_llauddsp_init_x86(LLAudDSPContext *c)
|
av_cold void ff_llauddsp_init_x86(LLAudDSPContext *c)
|
||||||
{
|
{
|
||||||
|
#if HAVE_YASM
|
||||||
int cpu_flags = av_get_cpu_flags();
|
int cpu_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
if (EXTERNAL_MMXEXT(cpu_flags))
|
if (EXTERNAL_MMXEXT(cpu_flags))
|
||||||
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmxext;
|
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_mmxext;
|
||||||
|
|
||||||
if (EXTERNAL_SSE2(cpu_flags))
|
if (EXTERNAL_SSE2(cpu_flags))
|
||||||
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_sse2;
|
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_sse2;
|
||||||
|
|
||||||
if (EXTERNAL_SSSE3(cpu_flags) &&
|
if (EXTERNAL_SSSE3(cpu_flags) &&
|
||||||
!(cpu_flags & (AV_CPU_FLAG_SSE42 | AV_CPU_FLAG_3DNOW))) // cachesplit
|
!(cpu_flags & (AV_CPU_FLAG_SSE42 | AV_CPU_FLAG_3DNOW))) // cachesplit
|
||||||
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_ssse3;
|
c->scalarproduct_and_madd_int16 = scalarproduct_and_madd_int16_ssse3;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
* X-Face common data and utilities definition.
|
* X-Face common data and utilities definition.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/avassert.h"
|
||||||
|
|
||||||
#include "xface.h"
|
#include "xface.h"
|
||||||
|
|
||||||
void ff_big_add(BigInt *b, uint8_t a)
|
void ff_big_add(BigInt *b, uint8_t a)
|
||||||
@ -43,6 +45,7 @@ void ff_big_add(BigInt *b, uint8_t a)
|
|||||||
c >>= XFACE_BITSPERWORD;
|
c >>= XFACE_BITSPERWORD;
|
||||||
}
|
}
|
||||||
if (i == b->nb_words && c) {
|
if (i == b->nb_words && c) {
|
||||||
|
av_assert0(b->nb_words < XFACE_MAX_WORDS);
|
||||||
b->nb_words++;
|
b->nb_words++;
|
||||||
*w = c & XFACE_WORDMASK;
|
*w = c & XFACE_WORDMASK;
|
||||||
}
|
}
|
||||||
@ -98,6 +101,7 @@ void ff_big_mul(BigInt *b, uint8_t a)
|
|||||||
return;
|
return;
|
||||||
if (a == 0) {
|
if (a == 0) {
|
||||||
/* treat this as a == WORDCARRY and just shift everything left a WORD */
|
/* treat this as a == WORDCARRY and just shift everything left a WORD */
|
||||||
|
av_assert0(b->nb_words < XFACE_MAX_WORDS);
|
||||||
i = b->nb_words++;
|
i = b->nb_words++;
|
||||||
w = b->words + i;
|
w = b->words + i;
|
||||||
while (i--) {
|
while (i--) {
|
||||||
@ -116,6 +120,7 @@ void ff_big_mul(BigInt *b, uint8_t a)
|
|||||||
c >>= XFACE_BITSPERWORD;
|
c >>= XFACE_BITSPERWORD;
|
||||||
}
|
}
|
||||||
if (c) {
|
if (c) {
|
||||||
|
av_assert0(b->nb_words < XFACE_MAX_WORDS);
|
||||||
b->nb_words++;
|
b->nb_words++;
|
||||||
*w = c & XFACE_WORDMASK;
|
*w = c & XFACE_WORDMASK;
|
||||||
}
|
}
|
||||||
|
@ -41,17 +41,17 @@
|
|||||||
/*
|
/*
|
||||||
* Image is encoded as a big integer, using characters from '~' to
|
* Image is encoded as a big integer, using characters from '~' to
|
||||||
* '!', for a total of 94 symbols. In order to express
|
* '!', for a total of 94 symbols. In order to express
|
||||||
* 48x48*2=8*XFACE_MAX_WORDS=4608
|
* 48x48 pixels with the worst case encoding 666 symbols should
|
||||||
* bits, we need a total of 704 digits, as given by:
|
* be sufficient.
|
||||||
* ceil(lg_94(2^4608)) = 704
|
|
||||||
*/
|
*/
|
||||||
#define XFACE_MAX_DIGITS 704
|
#define XFACE_MAX_DIGITS 666
|
||||||
|
|
||||||
#define XFACE_BITSPERWORD 8
|
#define XFACE_BITSPERWORD 8
|
||||||
#define XFACE_WORDCARRY (1 << XFACE_BITSPERWORD)
|
#define XFACE_WORDCARRY (1 << XFACE_BITSPERWORD)
|
||||||
#define XFACE_WORDMASK (XFACE_WORDCARRY - 1)
|
#define XFACE_WORDMASK (XFACE_WORDCARRY - 1)
|
||||||
|
|
||||||
#define XFACE_MAX_WORDS ((XFACE_PIXELS * 2 + XFACE_BITSPERWORD - 1) / XFACE_BITSPERWORD)
|
// This must be larger or equal to log256(94^XFACE_MAX_DIGITS)
|
||||||
|
#define XFACE_MAX_WORDS 546
|
||||||
|
|
||||||
/* Portable, very large unsigned integer arithmetic is needed.
|
/* Portable, very large unsigned integer arithmetic is needed.
|
||||||
* Implementation uses arrays of WORDs. */
|
* Implementation uses arrays of WORDs. */
|
||||||
|
@ -23,6 +23,9 @@
|
|||||||
#include "avdevice.h"
|
#include "avdevice.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_device_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
#define E AV_OPT_FLAG_ENCODING_PARAM
|
#define E AV_OPT_FLAG_ENCODING_PARAM
|
||||||
#define D AV_OPT_FLAG_DECODING_PARAM
|
#define D AV_OPT_FLAG_DECODING_PARAM
|
||||||
#define A AV_OPT_FLAG_AUDIO_PARAM
|
#define A AV_OPT_FLAG_AUDIO_PARAM
|
||||||
@ -131,9 +134,9 @@ int avdevice_app_to_dev_control_message(struct AVFormatContext *s, enum AVAppToD
|
|||||||
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
|
int avdevice_dev_to_app_control_message(struct AVFormatContext *s, enum AVDevToAppMessageType type,
|
||||||
void *data, size_t data_size)
|
void *data, size_t data_size)
|
||||||
{
|
{
|
||||||
if (!s->control_message_cb)
|
if (!av_format_get_control_message_cb(s))
|
||||||
return AVERROR(ENOSYS);
|
return AVERROR(ENOSYS);
|
||||||
return s->control_message_cb(s, type, data, data_size);
|
return av_format_get_control_message_cb(s)(s, type, data, data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
|
int avdevice_capabilities_create(AVDeviceCapabilitiesQuery **caps, AVFormatContext *s,
|
||||||
|
@ -350,7 +350,7 @@ static int iec61883_read_header(AVFormatContext *context)
|
|||||||
if (!dv->max_packets)
|
if (!dv->max_packets)
|
||||||
dv->max_packets = 100;
|
dv->max_packets = 100;
|
||||||
|
|
||||||
if (dv->type == IEC61883_HDV) {
|
if (CONFIG_MPEGTS_DEMUXER && dv->type == IEC61883_HDV) {
|
||||||
|
|
||||||
/* Init HDV receive */
|
/* Init HDV receive */
|
||||||
|
|
||||||
@ -444,7 +444,7 @@ static int iec61883_close(AVFormatContext *context)
|
|||||||
pthread_mutex_destroy(&dv->mutex);
|
pthread_mutex_destroy(&dv->mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (dv->type == IEC61883_HDV) {
|
if (CONFIG_MPEGTS_DEMUXER && dv->type == IEC61883_HDV) {
|
||||||
iec61883_mpeg2_recv_stop(dv->iec61883_mpeg2);
|
iec61883_mpeg2_recv_stop(dv->iec61883_mpeg2);
|
||||||
iec61883_mpeg2_close(dv->iec61883_mpeg2);
|
iec61883_mpeg2_close(dv->iec61883_mpeg2);
|
||||||
avpriv_mpegts_parse_close(dv->mpeg_demux);
|
avpriv_mpegts_parse_close(dv->mpeg_demux);
|
||||||
|
@ -496,6 +496,8 @@ static av_cold int init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "input%d", i);
|
snprintf(name, sizeof(name), "input%d", i);
|
||||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.filter_frame = filter_frame;
|
pad.filter_frame = filter_frame;
|
||||||
|
|
||||||
ff_insert_inpad(ctx, i, &pad);
|
ff_insert_inpad(ctx, i, &pad);
|
||||||
|
@ -214,6 +214,8 @@ static av_cold int join_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "input%d", i);
|
snprintf(name, sizeof(name), "input%d", i);
|
||||||
pad.type = AVMEDIA_TYPE_AUDIO;
|
pad.type = AVMEDIA_TYPE_AUDIO;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.filter_frame = filter_frame;
|
pad.filter_frame = filter_frame;
|
||||||
|
|
||||||
pad.needs_fifo = 1;
|
pad.needs_fifo = 1;
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
#include "formats.h"
|
#include "formats.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_filter_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
|
static int ff_filter_frame_framed(AVFilterLink *link, AVFrame *frame);
|
||||||
|
|
||||||
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
|
void ff_tlog_ref(void *ctx, AVFrame *ref, int end)
|
||||||
|
@ -52,6 +52,8 @@ static av_cold int split_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "output%d", i);
|
snprintf(name, sizeof(name), "output%d", i);
|
||||||
pad.type = ctx->filter->inputs[0].type;
|
pad.type = ctx->filter->inputs[0].type;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
ff_insert_outpad(ctx, i, &pad);
|
ff_insert_outpad(ctx, i, &pad);
|
||||||
}
|
}
|
||||||
|
@ -289,6 +289,8 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
|
|||||||
snprintf(name, sizeof(name), "out%d", i);
|
snprintf(name, sizeof(name), "out%d", i);
|
||||||
pad.type = movie->st[i].st->codec->codec_type;
|
pad.type = movie->st[i].st->codec->codec_type;
|
||||||
pad.name = av_strdup(name);
|
pad.name = av_strdup(name);
|
||||||
|
if (!pad.name)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
pad.config_props = movie_config_output_props;
|
pad.config_props = movie_config_output_props;
|
||||||
pad.request_frame = movie_request_frame;
|
pad.request_frame = movie_request_frame;
|
||||||
ff_insert_outpad(ctx, i, &pad);
|
ff_insert_outpad(ctx, i, &pad);
|
||||||
|
@ -534,7 +534,7 @@ static int config_input(AVFilterLink *inlink)
|
|||||||
/* each slice will need to (pre & re)process the top and bottom block of
|
/* each slice will need to (pre & re)process the top and bottom block of
|
||||||
* the previous one in in addition to its processing area. This is because
|
* the previous one in in addition to its processing area. This is because
|
||||||
* each pixel is averaged by all the surrounding blocks */
|
* each pixel is averaged by all the surrounding blocks */
|
||||||
slice_h = (int)ceilf(s->pr_height / s->nb_threads) + (s->bsize - 1) * 2;
|
slice_h = (int)ceilf(s->pr_height / (float)s->nb_threads) + (s->bsize - 1) * 2;
|
||||||
for (i = 0; i < s->nb_threads; i++) {
|
for (i = 0; i < s->nb_threads; i++) {
|
||||||
s->slices[i] = av_malloc_array(linesize, slice_h * sizeof(*s->slices[i]));
|
s->slices[i] = av_malloc_array(linesize, slice_h * sizeof(*s->slices[i]));
|
||||||
if (!s->slices[i])
|
if (!s->slices[i])
|
||||||
|
@ -82,6 +82,7 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
int width = ctx->inputs[LEFT]->w;
|
int width = ctx->inputs[LEFT]->w;
|
||||||
int height = ctx->inputs[LEFT]->h;
|
int height = ctx->inputs[LEFT]->h;
|
||||||
AVRational time_base = ctx->inputs[LEFT]->time_base;
|
AVRational time_base = ctx->inputs[LEFT]->time_base;
|
||||||
|
AVRational frame_rate = ctx->inputs[LEFT]->frame_rate;
|
||||||
|
|
||||||
// check size and fps match on the other input
|
// check size and fps match on the other input
|
||||||
if (width != ctx->inputs[RIGHT]->w ||
|
if (width != ctx->inputs[RIGHT]->w ||
|
||||||
@ -93,11 +94,18 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
} else if (av_cmp_q(time_base, ctx->inputs[RIGHT]->time_base) != 0) {
|
} else if (av_cmp_q(time_base, ctx->inputs[RIGHT]->time_base) != 0) {
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
"Left and right framerates differ (%d/%d vs %d/%d).\n",
|
"Left and right time bases differ (%d/%d vs %d/%d).\n",
|
||||||
time_base.num, time_base.den,
|
time_base.num, time_base.den,
|
||||||
ctx->inputs[RIGHT]->time_base.num,
|
ctx->inputs[RIGHT]->time_base.num,
|
||||||
ctx->inputs[RIGHT]->time_base.den);
|
ctx->inputs[RIGHT]->time_base.den);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
} else if (av_cmp_q(frame_rate, ctx->inputs[RIGHT]->frame_rate) != 0) {
|
||||||
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
|
"Left and right framerates differ (%d/%d vs %d/%d).\n",
|
||||||
|
frame_rate.num, frame_rate.den,
|
||||||
|
ctx->inputs[RIGHT]->frame_rate.num,
|
||||||
|
ctx->inputs[RIGHT]->frame_rate.den);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->pix_desc = av_pix_fmt_desc_get(outlink->format);
|
s->pix_desc = av_pix_fmt_desc_get(outlink->format);
|
||||||
@ -108,6 +116,8 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
switch (s->format) {
|
switch (s->format) {
|
||||||
case AV_STEREO3D_FRAMESEQUENCE:
|
case AV_STEREO3D_FRAMESEQUENCE:
|
||||||
time_base.den *= 2;
|
time_base.den *= 2;
|
||||||
|
frame_rate.num *= 2;
|
||||||
|
|
||||||
s->double_pts = AV_NOPTS_VALUE;
|
s->double_pts = AV_NOPTS_VALUE;
|
||||||
break;
|
break;
|
||||||
case AV_STEREO3D_COLUMNS:
|
case AV_STEREO3D_COLUMNS:
|
||||||
@ -126,6 +136,7 @@ static int config_output(AVFilterLink *outlink)
|
|||||||
outlink->w = width;
|
outlink->w = width;
|
||||||
outlink->h = height;
|
outlink->h = height;
|
||||||
outlink->time_base = time_base;
|
outlink->time_base = time_base;
|
||||||
|
outlink->frame_rate= frame_rate;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -220,6 +220,19 @@ static int config_props(AVFilterLink *inlink)
|
|||||||
|
|
||||||
#define NB_PLANES 4
|
#define NB_PLANES 4
|
||||||
|
|
||||||
|
static inline int mirror(int x, int w)
|
||||||
|
{
|
||||||
|
if (!w)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
while ((unsigned)x > (unsigned)w) {
|
||||||
|
x = -x;
|
||||||
|
if (x < 0)
|
||||||
|
x += 2 * w;
|
||||||
|
}
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
static void blur(uint8_t *dst, const int dst_linesize,
|
static void blur(uint8_t *dst, const int dst_linesize,
|
||||||
const uint8_t *src, const int src_linesize,
|
const uint8_t *src, const int src_linesize,
|
||||||
const int w, const int h, FilterParam *fp)
|
const int w, const int h, FilterParam *fp)
|
||||||
@ -253,8 +266,7 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
|||||||
for (dy = 0; dy < radius*2 + 1; dy++) {
|
for (dy = 0; dy < radius*2 + 1; dy++) {
|
||||||
int dx;
|
int dx;
|
||||||
int iy = y+dy - radius;
|
int iy = y+dy - radius;
|
||||||
if (iy < 0) iy = -iy;
|
iy = mirror(iy, h-1);
|
||||||
else if (iy >= h) iy = h+h-iy-1;
|
|
||||||
|
|
||||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||||
const int ix = x+dx - radius;
|
const int ix = x+dx - radius;
|
||||||
@ -265,13 +277,11 @@ static void blur(uint8_t *dst, const int dst_linesize,
|
|||||||
for (dy = 0; dy < radius*2+1; dy++) {
|
for (dy = 0; dy < radius*2+1; dy++) {
|
||||||
int dx;
|
int dx;
|
||||||
int iy = y+dy - radius;
|
int iy = y+dy - radius;
|
||||||
if (iy < 0) iy = -iy;
|
iy = mirror(iy, h-1);
|
||||||
else if (iy >= h) iy = h+h-iy-1;
|
|
||||||
|
|
||||||
for (dx = 0; dx < radius*2 + 1; dx++) {
|
for (dx = 0; dx < radius*2 + 1; dx++) {
|
||||||
int ix = x+dx - radius;
|
int ix = x+dx - radius;
|
||||||
if (ix < 0) ix = -ix;
|
ix = mirror(ix, w-1);
|
||||||
else if (ix >= w) ix = w+w-ix-1;
|
|
||||||
UPDATE_FACTOR;
|
UPDATE_FACTOR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ OBJS-$(CONFIG_RTP_MUXER) += rtp.o \
|
|||||||
rtpenc_h264.o \
|
rtpenc_h264.o \
|
||||||
rtpenc_vp8.o \
|
rtpenc_vp8.o \
|
||||||
rtpenc_xiph.o \
|
rtpenc_xiph.o \
|
||||||
avc.o
|
avc.o hevc.o
|
||||||
OBJS-$(CONFIG_RTSP_DEMUXER) += rtsp.o rtspdec.o httpauth.o \
|
OBJS-$(CONFIG_RTSP_DEMUXER) += rtsp.o rtspdec.o httpauth.o \
|
||||||
urldecode.o
|
urldecode.o
|
||||||
OBJS-$(CONFIG_RTSP_MUXER) += rtsp.o rtspenc.o httpauth.o \
|
OBJS-$(CONFIG_RTSP_MUXER) += rtsp.o rtspenc.o httpauth.o \
|
||||||
@ -519,6 +519,9 @@ OBJS-$(CONFIG_UNIX_PROTOCOL) += unix.o
|
|||||||
|
|
||||||
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
|
OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o
|
||||||
|
|
||||||
|
# libavdevice dependencies
|
||||||
|
OBJS-$(CONFIG_IEC61883_INDEV) += dv.o
|
||||||
|
|
||||||
# Windows resource file
|
# Windows resource file
|
||||||
SLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o
|
SLIBOBJS-$(HAVE_GNU_WINDRES) += avformatres.o
|
||||||
|
|
||||||
|
@ -404,7 +404,7 @@ static int apng_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
return 0;
|
return 0;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
char tag_buf[5];
|
char tag_buf[32];
|
||||||
|
|
||||||
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), tag);
|
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), tag);
|
||||||
avpriv_request_sample(s, "In-stream tag=%s (0x%08X) len=%"PRIu32, tag_buf, tag, len);
|
avpriv_request_sample(s, "In-stream tag=%s (0x%08X) len=%"PRIu32, tag_buf, tag, len);
|
||||||
|
@ -223,6 +223,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
|
|||||||
return offset1;
|
return offset1;
|
||||||
offset += offset1;
|
offset += offset1;
|
||||||
}
|
}
|
||||||
|
if (offset < 0)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
|
||||||
offset1 = offset - pos;
|
offset1 = offset - pos;
|
||||||
if (!s->must_flush && (!s->direct || !s->seek) &&
|
if (!s->must_flush && (!s->direct || !s->seek) &&
|
||||||
offset1 >= 0 && offset1 <= buffer_size) {
|
offset1 >= 0 && offset1 <= buffer_size) {
|
||||||
|
@ -127,6 +127,8 @@ static int cdxl_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
height = AV_RB16(&cdxl->header[16]);
|
height = AV_RB16(&cdxl->header[16]);
|
||||||
palette_size = AV_RB16(&cdxl->header[20]);
|
palette_size = AV_RB16(&cdxl->header[20]);
|
||||||
audio_size = AV_RB16(&cdxl->header[22]);
|
audio_size = AV_RB16(&cdxl->header[22]);
|
||||||
|
if (FFALIGN(width, 16) * (uint64_t)height * cdxl->header[19] > INT_MAX)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
image_size = FFALIGN(width, 16) * height * cdxl->header[19] / 8;
|
||||||
video_size = palette_size + image_size;
|
video_size = palette_size + image_size;
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary
|
|||||||
c->key, c->keylen, "decryption key")) < 0)
|
c->key, c->keylen, "decryption key")) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
if ((ret = set_aes_arg(c, &c->decrypt_iv, &c->decrypt_ivlen,
|
if ((ret = set_aes_arg(c, &c->decrypt_iv, &c->decrypt_ivlen,
|
||||||
c->key, c->keylen, "decryption IV")) < 0)
|
c->iv, c->ivlen, "decryption IV")) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -132,7 +132,7 @@ static int crypto_open2(URLContext *h, const char *uri, int flags, AVDictionary
|
|||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto err;
|
goto err;
|
||||||
if ((ret = set_aes_arg(c, &c->encrypt_iv, &c->encrypt_ivlen,
|
if ((ret = set_aes_arg(c, &c->encrypt_iv, &c->encrypt_ivlen,
|
||||||
c->key, c->keylen, "encryption IV")) < 0)
|
c->iv, c->ivlen, "encryption IV")) < 0)
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -390,7 +390,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
|
|||||||
FLVContext *flv = s->priv_data;
|
FLVContext *flv = s->priv_data;
|
||||||
AVIOContext *ioc;
|
AVIOContext *ioc;
|
||||||
AMFDataType amf_type;
|
AMFDataType amf_type;
|
||||||
char str_val[256];
|
char str_val[1024];
|
||||||
double num_val;
|
double num_val;
|
||||||
|
|
||||||
num_val = 0;
|
num_val = 0;
|
||||||
@ -459,11 +459,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (key) {
|
if (key) {
|
||||||
|
acodec = astream ? astream->codec : NULL;
|
||||||
|
vcodec = vstream ? vstream->codec : NULL;
|
||||||
|
|
||||||
// stream info doesn't live any deeper than the first object
|
// stream info doesn't live any deeper than the first object
|
||||||
if (depth == 1) {
|
if (depth == 1) {
|
||||||
acodec = astream ? astream->codec : NULL;
|
|
||||||
vcodec = vstream ? vstream->codec : NULL;
|
|
||||||
|
|
||||||
if (amf_type == AMF_DATA_TYPE_NUMBER ||
|
if (amf_type == AMF_DATA_TYPE_NUMBER ||
|
||||||
amf_type == AMF_DATA_TYPE_BOOL) {
|
amf_type == AMF_DATA_TYPE_BOOL) {
|
||||||
if (!strcmp(key, "duration"))
|
if (!strcmp(key, "duration"))
|
||||||
@ -558,13 +558,13 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
|
|||||||
type = avio_r8(ioc);
|
type = avio_r8(ioc);
|
||||||
if (type != AMF_DATA_TYPE_STRING ||
|
if (type != AMF_DATA_TYPE_STRING ||
|
||||||
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
|
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
|
||||||
return -1;
|
return 2;
|
||||||
|
|
||||||
if (!strcmp(buffer, "onTextData"))
|
if (!strcmp(buffer, "onTextData"))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint"))
|
if (strcmp(buffer, "onMetaData") && strcmp(buffer, "onCuePoint"))
|
||||||
return -1;
|
return 2;
|
||||||
|
|
||||||
// find the streams now so that amf_parse_object doesn't need to do
|
// find the streams now so that amf_parse_object doesn't need to do
|
||||||
// the lookup every time it is called.
|
// the lookup every time it is called.
|
||||||
@ -623,7 +623,7 @@ static int flv_read_close(AVFormatContext *s)
|
|||||||
|
|
||||||
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
|
||||||
{
|
{
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if (ff_get_extradata(st->codec, s->pb, size) < 0)
|
if (ff_get_extradata(st->codec, s->pb, size) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
return 0;
|
return 0;
|
||||||
@ -822,7 +822,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
stream_type=FLV_STREAM_TYPE_DATA;
|
stream_type=FLV_STREAM_TYPE_DATA;
|
||||||
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
|
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
|
||||||
meta_pos = avio_tell(s->pb);
|
meta_pos = avio_tell(s->pb);
|
||||||
if (flv_read_metabody(s, next) == 0) {
|
if (flv_read_metabody(s, next) <= 0) {
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
avio_seek(s->pb, meta_pos, SEEK_SET);
|
avio_seek(s->pb, meta_pos, SEEK_SET);
|
||||||
|
@ -145,15 +145,15 @@ static void hds_free(AVFormatContext *s)
|
|||||||
if (os->ctx && os->ctx_inited)
|
if (os->ctx && os->ctx_inited)
|
||||||
av_write_trailer(os->ctx);
|
av_write_trailer(os->ctx);
|
||||||
if (os->ctx && os->ctx->pb)
|
if (os->ctx && os->ctx->pb)
|
||||||
av_free(os->ctx->pb);
|
av_freep(&os->ctx->pb);
|
||||||
if (os->ctx)
|
if (os->ctx)
|
||||||
avformat_free_context(os->ctx);
|
avformat_free_context(os->ctx);
|
||||||
av_free(os->metadata);
|
av_freep(&os->metadata);
|
||||||
for (j = 0; j < os->nb_extra_packets; j++)
|
for (j = 0; j < os->nb_extra_packets; j++)
|
||||||
av_free(os->extra_packets[j]);
|
av_freep(&os->extra_packets[j]);
|
||||||
for (j = 0; j < os->nb_fragments; j++)
|
for (j = 0; j < os->nb_fragments; j++)
|
||||||
av_free(os->fragments[j]);
|
av_freep(&os->fragments[j]);
|
||||||
av_free(os->fragments);
|
av_freep(&os->fragments);
|
||||||
}
|
}
|
||||||
av_freep(&c->streams);
|
av_freep(&c->streams);
|
||||||
}
|
}
|
||||||
@ -499,7 +499,7 @@ static int hds_flush(AVFormatContext *s, OutputStream *os, int final,
|
|||||||
if (remove > 0) {
|
if (remove > 0) {
|
||||||
for (i = 0; i < remove; i++) {
|
for (i = 0; i < remove; i++) {
|
||||||
unlink(os->fragments[i]->file);
|
unlink(os->fragments[i]->file);
|
||||||
av_free(os->fragments[i]);
|
av_freep(&os->fragments[i]);
|
||||||
}
|
}
|
||||||
os->nb_fragments -= remove;
|
os->nb_fragments -= remove;
|
||||||
memmove(os->fragments, os->fragments + remove,
|
memmove(os->fragments, os->fragments + remove,
|
||||||
|
@ -189,6 +189,7 @@ typedef struct MOVContext {
|
|||||||
int has_looked_for_mfra;
|
int has_looked_for_mfra;
|
||||||
MOVFragmentIndex** fragment_index_data;
|
MOVFragmentIndex** fragment_index_data;
|
||||||
unsigned fragment_index_count;
|
unsigned fragment_index_count;
|
||||||
|
int atom_depth;
|
||||||
} MOVContext;
|
} MOVContext;
|
||||||
|
|
||||||
int ff_mp4_read_descr_len(AVIOContext *pb);
|
int ff_mp4_read_descr_len(AVIOContext *pb);
|
||||||
|
@ -1080,7 +1080,7 @@ static void ebml_free(EbmlSyntax *syntax, void *data)
|
|||||||
for (j = 0; j < list->nb_elem;
|
for (j = 0; j < list->nb_elem;
|
||||||
j++, ptr += syntax[i].list_elem_size)
|
j++, ptr += syntax[i].list_elem_size)
|
||||||
ebml_free(syntax[i].def.n, ptr);
|
ebml_free(syntax[i].def.n, ptr);
|
||||||
av_free(list->elem);
|
av_freep(&list->elem);
|
||||||
} else
|
} else
|
||||||
ebml_free(syntax[i].def.n, data_off);
|
ebml_free(syntax[i].def.n, data_off);
|
||||||
default:
|
default:
|
||||||
@ -1414,13 +1414,17 @@ static void matroska_execute_seekhead(MatroskaDemuxContext *matroska)
|
|||||||
EbmlList *seekhead_list = &matroska->seekhead;
|
EbmlList *seekhead_list = &matroska->seekhead;
|
||||||
int64_t before_pos = avio_tell(matroska->ctx->pb);
|
int64_t before_pos = avio_tell(matroska->ctx->pb);
|
||||||
int i;
|
int i;
|
||||||
|
int nb_elem;
|
||||||
|
|
||||||
// we should not do any seeking in the streaming case
|
// we should not do any seeking in the streaming case
|
||||||
if (!matroska->ctx->pb->seekable ||
|
if (!matroska->ctx->pb->seekable ||
|
||||||
(matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
|
(matroska->ctx->flags & AVFMT_FLAG_IGNIDX))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (i = 0; i < seekhead_list->nb_elem; i++) {
|
// do not read entries that are added while parsing seekhead entries
|
||||||
|
nb_elem = seekhead_list->nb_elem;
|
||||||
|
|
||||||
|
for (i = 0; i < nb_elem; i++) {
|
||||||
MatroskaSeekhead *seekhead = seekhead_list->elem;
|
MatroskaSeekhead *seekhead = seekhead_list->elem;
|
||||||
if (seekhead[i].pos <= before_pos)
|
if (seekhead[i].pos <= before_pos)
|
||||||
continue;
|
continue;
|
||||||
@ -1922,8 +1926,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
|
|||||||
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den,
|
||||||
1000000000, track->default_duration, 30000);
|
1000000000, track->default_duration, 30000);
|
||||||
#if FF_API_R_FRAME_RATE
|
#if FF_API_R_FRAME_RATE
|
||||||
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000L
|
if ( st->avg_frame_rate.num < st->avg_frame_rate.den * 1000LL
|
||||||
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5L)
|
&& st->avg_frame_rate.num > st->avg_frame_rate.den * 5LL)
|
||||||
st->r_frame_rate = st->avg_frame_rate;
|
st->r_frame_rate = st->avg_frame_rate;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -2130,7 +2134,7 @@ static int matroska_deliver_packet(MatroskaDemuxContext *matroska,
|
|||||||
{
|
{
|
||||||
if (matroska->num_packets > 0) {
|
if (matroska->num_packets > 0) {
|
||||||
memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
|
memcpy(pkt, matroska->packets[0], sizeof(AVPacket));
|
||||||
av_free(matroska->packets[0]);
|
av_freep(&matroska->packets[0]);
|
||||||
if (matroska->num_packets > 1) {
|
if (matroska->num_packets > 1) {
|
||||||
void *newpackets;
|
void *newpackets;
|
||||||
memmove(&matroska->packets[0], &matroska->packets[1],
|
memmove(&matroska->packets[0], &matroska->packets[1],
|
||||||
@ -2161,7 +2165,7 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
|||||||
int n;
|
int n;
|
||||||
for (n = 0; n < matroska->num_packets; n++) {
|
for (n = 0; n < matroska->num_packets; n++) {
|
||||||
av_free_packet(matroska->packets[n]);
|
av_free_packet(matroska->packets[n]);
|
||||||
av_free(matroska->packets[n]);
|
av_freep(&matroska->packets[n]);
|
||||||
}
|
}
|
||||||
av_freep(&matroska->packets);
|
av_freep(&matroska->packets);
|
||||||
matroska->num_packets = 0;
|
matroska->num_packets = 0;
|
||||||
@ -2999,7 +3003,7 @@ static int matroska_read_close(AVFormatContext *s)
|
|||||||
|
|
||||||
for (n = 0; n < matroska->tracks.nb_elem; n++)
|
for (n = 0; n < matroska->tracks.nb_elem; n++)
|
||||||
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
|
if (tracks[n].type == MATROSKA_TRACK_TYPE_AUDIO)
|
||||||
av_free(tracks[n].audio.buf);
|
av_freep(&tracks[n].audio.buf);
|
||||||
ebml_free(matroska_cluster, &matroska->current_cluster);
|
ebml_free(matroska_cluster, &matroska->current_cluster);
|
||||||
ebml_free(matroska_segment, matroska);
|
ebml_free(matroska_segment, matroska);
|
||||||
|
|
||||||
|
@ -210,7 +210,11 @@ static int mov_read_covr(MOVContext *c, AVIOContext *pb, int type, int len)
|
|||||||
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
|
static int mov_metadata_raw(MOVContext *c, AVIOContext *pb,
|
||||||
unsigned len, const char *key)
|
unsigned len, const char *key)
|
||||||
{
|
{
|
||||||
char *value = av_malloc(len + 1);
|
char *value;
|
||||||
|
// Check for overflow.
|
||||||
|
if (len >= INT_MAX)
|
||||||
|
return AVERROR(EINVAL);
|
||||||
|
value = av_malloc(len + 1);
|
||||||
if (!value)
|
if (!value)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
avio_read(pb, value, len);
|
avio_read(pb, value, len);
|
||||||
@ -352,7 +356,7 @@ static int mov_read_udta_string(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
if (!key)
|
if (!key)
|
||||||
return 0;
|
return 0;
|
||||||
if (atom.size < 0)
|
if (atom.size < 0 || str_size >= INT_MAX/2)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
str_size_alloc = str_size << 1; // worst-case requirement for output string in case of utf8 coded input
|
str_size_alloc = str_size << 1; // worst-case requirement for output string in case of utf8 coded input
|
||||||
@ -1150,7 +1154,7 @@ static int mov_read_wave(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
st->codec->codec_id == AV_CODEC_ID_QDMC ||
|
st->codec->codec_id == AV_CODEC_ID_QDMC ||
|
||||||
st->codec->codec_id == AV_CODEC_ID_SPEEX) {
|
st->codec->codec_id == AV_CODEC_ID_SPEEX) {
|
||||||
// pass all frma atom to codec, needed at least for QDMC and QDM2
|
// pass all frma atom to codec, needed at least for QDMC and QDM2
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if (ff_get_extradata(st->codec, pb, atom.size) < 0)
|
if (ff_get_extradata(st->codec, pb, atom.size) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
} else if (atom.size > 8) { /* to read frma, esds atoms */
|
} else if (atom.size > 8) { /* to read frma, esds atoms */
|
||||||
@ -1190,7 +1194,7 @@ static int mov_read_glbl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
av_log(c, AV_LOG_WARNING, "ignoring multiple glbl\n");
|
av_log(c, AV_LOG_WARNING, "ignoring multiple glbl\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if (ff_get_extradata(st->codec, pb, atom.size) < 0)
|
if (ff_get_extradata(st->codec, pb, atom.size) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
@ -1215,7 +1219,7 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
avio_seek(pb, 6, SEEK_CUR);
|
avio_seek(pb, 6, SEEK_CUR);
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if ((ret = ff_get_extradata(st->codec, pb, atom.size - 7)) < 0)
|
if ((ret = ff_get_extradata(st->codec, pb, atom.size - 7)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -1241,7 +1245,7 @@ static int mov_read_strf(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
avio_skip(pb, 40);
|
avio_skip(pb, 40);
|
||||||
av_free(st->codec->extradata);
|
av_freep(&st->codec->extradata);
|
||||||
if (ff_get_extradata(st->codec, pb, atom.size - 40) < 0)
|
if (ff_get_extradata(st->codec, pb, atom.size - 40) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
return 0;
|
return 0;
|
||||||
@ -1550,7 +1554,7 @@ static void mov_parse_stsd_audio(MOVContext *c, AVIOContext *pb,
|
|||||||
|
|
||||||
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
|
static void mov_parse_stsd_subtitle(MOVContext *c, AVIOContext *pb,
|
||||||
AVStream *st, MOVStreamContext *sc,
|
AVStream *st, MOVStreamContext *sc,
|
||||||
int size)
|
int64_t size)
|
||||||
{
|
{
|
||||||
// ttxt stsd contains display flags, justification, background
|
// ttxt stsd contains display flags, justification, background
|
||||||
// color, fonts, and default styles, so fake an atom to read it
|
// color, fonts, and default styles, so fake an atom to read it
|
||||||
@ -1615,10 +1619,10 @@ static int mov_rewrite_dvd_sub_extradata(AVStream *st)
|
|||||||
|
|
||||||
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
|
static int mov_parse_stsd_data(MOVContext *c, AVIOContext *pb,
|
||||||
AVStream *st, MOVStreamContext *sc,
|
AVStream *st, MOVStreamContext *sc,
|
||||||
int size)
|
int64_t size)
|
||||||
{
|
{
|
||||||
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
|
if (st->codec->codec_tag == MKTAG('t','m','c','d')) {
|
||||||
if (ff_get_extradata(st->codec, pb, size) < 0)
|
if ((int)size != size || ff_get_extradata(st->codec, pb, size) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
if (size > 16) {
|
if (size > 16) {
|
||||||
MOVStreamContext *tmcd_ctx = st->priv_data;
|
MOVStreamContext *tmcd_ctx = st->priv_data;
|
||||||
@ -3388,6 +3392,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
MOVAtom a;
|
MOVAtom a;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
if (c->atom_depth > 10) {
|
||||||
|
av_log(c->fc, AV_LOG_ERROR, "Atoms too deeply nested\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
c->atom_depth ++;
|
||||||
|
|
||||||
if (atom.size < 0)
|
if (atom.size < 0)
|
||||||
atom.size = INT64_MAX;
|
atom.size = INT64_MAX;
|
||||||
while (total_size + 8 <= atom.size && !avio_feof(pb)) {
|
while (total_size + 8 <= atom.size && !avio_feof(pb)) {
|
||||||
@ -3417,11 +3427,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
{
|
{
|
||||||
av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n");
|
av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n");
|
||||||
avio_skip(pb, -8);
|
avio_skip(pb, -8);
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
total_size += 8;
|
total_size += 8;
|
||||||
if (a.size == 1) { /* 64 bit extended size */
|
if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */
|
||||||
a.size = avio_rb64(pb) - 8;
|
a.size = avio_rb64(pb) - 8;
|
||||||
total_size += 8;
|
total_size += 8;
|
||||||
}
|
}
|
||||||
@ -3453,13 +3464,16 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
int64_t start_pos = avio_tell(pb);
|
int64_t start_pos = avio_tell(pb);
|
||||||
int64_t left;
|
int64_t left;
|
||||||
int err = parse(c, pb, a);
|
int err = parse(c, pb, a);
|
||||||
if (err < 0)
|
if (err < 0) {
|
||||||
|
c->atom_depth --;
|
||||||
return err;
|
return err;
|
||||||
|
}
|
||||||
if (c->found_moov && c->found_mdat &&
|
if (c->found_moov && c->found_mdat &&
|
||||||
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
|
((!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX) ||
|
||||||
start_pos + a.size == avio_size(pb))) {
|
start_pos + a.size == avio_size(pb))) {
|
||||||
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
|
if (!pb->seekable || c->fc->flags & AVFMT_FLAG_IGNIDX)
|
||||||
c->next_root_atom = start_pos + a.size;
|
c->next_root_atom = start_pos + a.size;
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
left = a.size - avio_tell(pb) + start_pos;
|
left = a.size - avio_tell(pb) + start_pos;
|
||||||
@ -3479,6 +3493,7 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
if (total_size < atom.size && atom.size < 0x7ffff)
|
if (total_size < atom.size && atom.size < 0x7ffff)
|
||||||
avio_skip(pb, atom.size - total_size);
|
avio_skip(pb, atom.size - total_size);
|
||||||
|
|
||||||
|
c->atom_depth --;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3768,35 +3783,39 @@ static void export_orphan_timecode(AVFormatContext *s)
|
|||||||
static int read_tfra(MOVContext *mov, AVIOContext *f)
|
static int read_tfra(MOVContext *mov, AVIOContext *f)
|
||||||
{
|
{
|
||||||
MOVFragmentIndex* index = NULL;
|
MOVFragmentIndex* index = NULL;
|
||||||
int version, fieldlength, i, j, err;
|
int version, fieldlength, i, j;
|
||||||
int64_t pos = avio_tell(f);
|
int64_t pos = avio_tell(f);
|
||||||
uint32_t size = avio_rb32(f);
|
uint32_t size = avio_rb32(f);
|
||||||
|
void *tmp;
|
||||||
|
|
||||||
if (avio_rb32(f) != MKBETAG('t', 'f', 'r', 'a')) {
|
if (avio_rb32(f) != MKBETAG('t', 'f', 'r', 'a')) {
|
||||||
return -1;
|
return 1;
|
||||||
}
|
}
|
||||||
av_log(mov->fc, AV_LOG_VERBOSE, "found tfra\n");
|
av_log(mov->fc, AV_LOG_VERBOSE, "found tfra\n");
|
||||||
index = av_mallocz(sizeof(MOVFragmentIndex));
|
index = av_mallocz(sizeof(MOVFragmentIndex));
|
||||||
if (!index) {
|
if (!index) {
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
mov->fragment_index_count++;
|
|
||||||
if ((err = av_reallocp(&mov->fragment_index_data,
|
tmp = av_realloc_array(mov->fragment_index_data,
|
||||||
mov->fragment_index_count *
|
mov->fragment_index_count + 1,
|
||||||
sizeof(MOVFragmentIndex*))) < 0) {
|
sizeof(MOVFragmentIndex*));
|
||||||
|
if (!tmp) {
|
||||||
av_freep(&index);
|
av_freep(&index);
|
||||||
return err;
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
mov->fragment_index_data[mov->fragment_index_count - 1] =
|
mov->fragment_index_data = tmp;
|
||||||
index;
|
mov->fragment_index_data[mov->fragment_index_count++] = index;
|
||||||
|
|
||||||
version = avio_r8(f);
|
version = avio_r8(f);
|
||||||
avio_rb24(f);
|
avio_rb24(f);
|
||||||
index->track_id = avio_rb32(f);
|
index->track_id = avio_rb32(f);
|
||||||
fieldlength = avio_rb32(f);
|
fieldlength = avio_rb32(f);
|
||||||
index->item_count = avio_rb32(f);
|
index->item_count = avio_rb32(f);
|
||||||
index->items = av_mallocz(
|
index->items = av_mallocz_array(
|
||||||
index->item_count * sizeof(MOVFragmentIndexItem));
|
index->item_count, sizeof(MOVFragmentIndexItem));
|
||||||
if (!index->items) {
|
if (!index->items) {
|
||||||
|
index->item_count = 0;
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
for (i = 0; i < index->item_count; i++) {
|
for (i = 0; i < index->item_count; i++) {
|
||||||
@ -3850,11 +3869,13 @@ static int mov_read_mfra(MOVContext *c, AVIOContext *f)
|
|||||||
av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n");
|
av_log(c->fc, AV_LOG_DEBUG, "doesn't look like mfra (tag mismatch)\n");
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
ret = 0;
|
|
||||||
av_log(c->fc, AV_LOG_VERBOSE, "stream has mfra\n");
|
av_log(c->fc, AV_LOG_VERBOSE, "stream has mfra\n");
|
||||||
while (!read_tfra(c, f)) {
|
do {
|
||||||
/* Empty */
|
ret = read_tfra(c, f);
|
||||||
}
|
if (ret < 0)
|
||||||
|
goto fail;
|
||||||
|
} while (!ret);
|
||||||
|
ret = 0;
|
||||||
fail:
|
fail:
|
||||||
seek_ret = avio_seek(f, original_pos, SEEK_SET);
|
seek_ret = avio_seek(f, original_pos, SEEK_SET);
|
||||||
if (seek_ret < 0) {
|
if (seek_ret < 0) {
|
||||||
@ -4093,7 +4114,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
#if CONFIG_DV_DEMUXER
|
#if CONFIG_DV_DEMUXER
|
||||||
if (mov->dv_demux && sc->dv_audio_container) {
|
if (mov->dv_demux && sc->dv_audio_container) {
|
||||||
avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
|
avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
|
||||||
av_free(pkt->data);
|
av_freep(&pkt->data);
|
||||||
pkt->size = 0;
|
pkt->size = 0;
|
||||||
ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
|
ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
@ -2499,7 +2499,8 @@ static int mov_write_mvhd_tag(AVIOContext *pb, MOVMuxContext *mov)
|
|||||||
}
|
}
|
||||||
|
|
||||||
version = max_track_len < UINT32_MAX ? 0 : 1;
|
version = max_track_len < UINT32_MAX ? 0 : 1;
|
||||||
(version == 1) ? avio_wb32(pb, 120) : avio_wb32(pb, 108); /* size */
|
avio_wb32(pb, version == 1 ? 120 : 108); /* size */
|
||||||
|
|
||||||
ffio_wfourcc(pb, "mvhd");
|
ffio_wfourcc(pb, "mvhd");
|
||||||
avio_w8(pb, version);
|
avio_w8(pb, version);
|
||||||
avio_wb24(pb, 0); /* flags */
|
avio_wb24(pb, 0); /* flags */
|
||||||
|
@ -57,7 +57,7 @@ typedef struct {
|
|||||||
|
|
||||||
static inline int64_t bs_get_v(const uint8_t **bs)
|
static inline int64_t bs_get_v(const uint8_t **bs)
|
||||||
{
|
{
|
||||||
int64_t v = 0;
|
uint64_t v = 0;
|
||||||
int br = 0;
|
int br = 0;
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
@ -91,7 +91,7 @@ static int mpc8_probe(AVProbeData *p)
|
|||||||
size = bs_get_v(&bs);
|
size = bs_get_v(&bs);
|
||||||
if (size < 2)
|
if (size < 2)
|
||||||
return 0;
|
return 0;
|
||||||
if (bs + size - 2 >= bs_end)
|
if (size >= bs_end - bs + 2)
|
||||||
return AVPROBE_SCORE_EXTENSION - 1; // seems to be valid MPC but no header yet
|
return AVPROBE_SCORE_EXTENSION - 1; // seems to be valid MPC but no header yet
|
||||||
if (header_found) {
|
if (header_found) {
|
||||||
if (size < 11 || size > 28)
|
if (size < 11 || size > 28)
|
||||||
@ -108,7 +108,7 @@ static int mpc8_probe(AVProbeData *p)
|
|||||||
|
|
||||||
static inline int64_t gb_get_v(GetBitContext *gb)
|
static inline int64_t gb_get_v(GetBitContext *gb)
|
||||||
{
|
{
|
||||||
int64_t v = 0;
|
uint64_t v = 0;
|
||||||
int bits = 0;
|
int bits = 0;
|
||||||
while(get_bits1(gb) && bits < 64-7){
|
while(get_bits1(gb) && bits < 64-7){
|
||||||
v <<= 7;
|
v <<= 7;
|
||||||
@ -223,6 +223,10 @@ static int mpc8_read_header(AVFormatContext *s)
|
|||||||
while(!avio_feof(pb)){
|
while(!avio_feof(pb)){
|
||||||
pos = avio_tell(pb);
|
pos = avio_tell(pb);
|
||||||
mpc8_get_chunk_header(pb, &tag, &size);
|
mpc8_get_chunk_header(pb, &tag, &size);
|
||||||
|
if (size < 0) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Invalid chunk length\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
if(tag == TAG_STREAMHDR)
|
if(tag == TAG_STREAMHDR)
|
||||||
break;
|
break;
|
||||||
mpc8_handle_chunk(s, tag, pos, size);
|
mpc8_handle_chunk(s, tag, pos, size);
|
||||||
|
@ -70,20 +70,23 @@ static int mpegps_probe(AVProbeData *p)
|
|||||||
int i;
|
int i;
|
||||||
int sys = 0, pspack = 0, priv1 = 0, vid = 0;
|
int sys = 0, pspack = 0, priv1 = 0, vid = 0;
|
||||||
int audio = 0, invalid = 0, score = 0;
|
int audio = 0, invalid = 0, score = 0;
|
||||||
|
int endpes = 0;
|
||||||
|
|
||||||
for (i = 0; i < p->buf_size; i++) {
|
for (i = 0; i < p->buf_size; i++) {
|
||||||
code = (code << 8) + p->buf[i];
|
code = (code << 8) + p->buf[i];
|
||||||
if ((code & 0xffffff00) == 0x100) {
|
if ((code & 0xffffff00) == 0x100) {
|
||||||
int len = p->buf[i + 1] << 8 | p->buf[i + 2];
|
int len = p->buf[i + 1] << 8 | p->buf[i + 2];
|
||||||
int pes = check_pes(p->buf + i, p->buf + p->buf_size);
|
int pes = endpes <= i && check_pes(p->buf + i, p->buf + p->buf_size);
|
||||||
int pack = check_pack_header(p->buf + i);
|
int pack = check_pack_header(p->buf + i);
|
||||||
|
|
||||||
if (code == SYSTEM_HEADER_START_CODE)
|
if (code == SYSTEM_HEADER_START_CODE)
|
||||||
sys++;
|
sys++;
|
||||||
else if (code == PACK_START_CODE && pack)
|
else if (code == PACK_START_CODE && pack)
|
||||||
pspack++;
|
pspack++;
|
||||||
else if ((code & 0xf0) == VIDEO_ID && pes)
|
else if ((code & 0xf0) == VIDEO_ID && pes) {
|
||||||
|
endpes = i + len;
|
||||||
vid++;
|
vid++;
|
||||||
|
}
|
||||||
// skip pes payload to avoid start code emulation for private
|
// skip pes payload to avoid start code emulation for private
|
||||||
// and audio streams
|
// and audio streams
|
||||||
else if ((code & 0xe0) == AUDIO_ID && pes) {audio++; i+=len;}
|
else if ((code & 0xe0) == AUDIO_ID && pes) {audio++; i+=len;}
|
||||||
|
@ -174,7 +174,7 @@ static int nprobe(AVFormatContext *s, uint8_t *enc_header, unsigned size,
|
|||||||
taglen = AV_RB32(&enc_header[pos + 32]);
|
taglen = AV_RB32(&enc_header[pos + 32]);
|
||||||
datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
|
datalen = AV_RB32(&enc_header[pos + 36]) >> 4;
|
||||||
|
|
||||||
pos += 44L + taglen;
|
pos += 44LL + taglen;
|
||||||
|
|
||||||
if (pos + (((uint64_t)datalen) << 4) > size)
|
if (pos + (((uint64_t)datalen) << 4) > size)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -159,9 +159,9 @@ void ff_freeaddrinfo(struct addrinfo *res)
|
|||||||
}
|
}
|
||||||
#endif /* HAVE_WINSOCK2_H */
|
#endif /* HAVE_WINSOCK2_H */
|
||||||
|
|
||||||
av_free(res->ai_canonname);
|
av_freep(&res->ai_canonname);
|
||||||
av_free(res->ai_addr);
|
av_freep(&res->ai_addr);
|
||||||
av_free(res);
|
av_freep(&res);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ff_getnameinfo(const struct sockaddr *sa, int salen,
|
int ff_getnameinfo(const struct sockaddr *sa, int salen,
|
||||||
|
@ -114,7 +114,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size)
|
|||||||
size -= 22;
|
size -= 22;
|
||||||
}
|
}
|
||||||
if (cbSize > 0) {
|
if (cbSize > 0) {
|
||||||
av_free(codec->extradata);
|
av_freep(&codec->extradata);
|
||||||
if (ff_get_extradata(codec, pb, cbSize) < 0)
|
if (ff_get_extradata(codec, pb, cbSize) < 0)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
size -= cbSize;
|
size -= cbSize;
|
||||||
|
@ -412,7 +412,11 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
|
|||||||
skip:
|
skip:
|
||||||
/* skip codec info */
|
/* skip codec info */
|
||||||
size = avio_tell(pb) - codec_pos;
|
size = avio_tell(pb) - codec_pos;
|
||||||
avio_skip(pb, codec_data_size - size);
|
if (codec_data_size >= size) {
|
||||||
|
avio_skip(pb, codec_data_size - size);
|
||||||
|
} else {
|
||||||
|
av_log(s, AV_LOG_WARNING, "codec_data_size %u < size %d\n", codec_data_size, size);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,7 @@ static int rsd_read_header(AVFormatContext *s)
|
|||||||
codec->codec_tag = avio_rl32(pb);
|
codec->codec_tag = avio_rl32(pb);
|
||||||
codec->codec_id = ff_codec_get_id(rsd_tags, codec->codec_tag);
|
codec->codec_id = ff_codec_get_id(rsd_tags, codec->codec_tag);
|
||||||
if (!codec->codec_id) {
|
if (!codec->codec_id) {
|
||||||
char tag_buf[5];
|
char tag_buf[32];
|
||||||
|
|
||||||
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), codec->codec_tag);
|
av_get_codec_tag_string(tag_buf, sizeof(tag_buf), codec->codec_tag);
|
||||||
for (i=0; i < FF_ARRAY_ELEMS(rsd_unsupported_tags); i++) {
|
for (i=0; i < FF_ARRAY_ELEMS(rsd_unsupported_tags); i++) {
|
||||||
|
@ -217,9 +217,8 @@ static void free_tracked_methods(RTMPContext *rt)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < rt->nb_tracked_methods; i ++)
|
for (i = 0; i < rt->nb_tracked_methods; i ++)
|
||||||
av_free(rt->tracked_methods[i].name);
|
av_freep(&rt->tracked_methods[i].name);
|
||||||
av_free(rt->tracked_methods);
|
av_freep(&rt->tracked_methods);
|
||||||
rt->tracked_methods = NULL;
|
|
||||||
rt->tracked_methods_size = 0;
|
rt->tracked_methods_size = 0;
|
||||||
rt->nb_tracked_methods = 0;
|
rt->nb_tracked_methods = 0;
|
||||||
}
|
}
|
||||||
@ -2552,7 +2551,7 @@ static int inject_fake_duration_metadata(RTMPContext *rt)
|
|||||||
// Increase the size by the injected packet
|
// Increase the size by the injected packet
|
||||||
rt->flv_size += 55;
|
rt->flv_size += 55;
|
||||||
// Delete the old FLV data
|
// Delete the old FLV data
|
||||||
av_free(old_flv_data);
|
av_freep(&old_flv_data);
|
||||||
|
|
||||||
p = rt->flv_data + 13;
|
p = rt->flv_data + 13;
|
||||||
bytestream_put_byte(&p, FLV_TAG_TYPE_META);
|
bytestream_put_byte(&p, FLV_TAG_TYPE_META);
|
||||||
|
@ -83,6 +83,7 @@ static int h263_handle_packet(AVFormatContext *ctx, PayloadContext *data,
|
|||||||
avio_close_dyn_buf(data->buf, &p);
|
avio_close_dyn_buf(data->buf, &p);
|
||||||
av_free(p);
|
av_free(p);
|
||||||
data->buf = NULL;
|
data->buf = NULL;
|
||||||
|
data->endbyte_bits = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (len < 4) {
|
if (len < 4) {
|
||||||
|
@ -343,7 +343,7 @@ static int segment_end(AVFormatContext *s, int write_trailer, int is_last)
|
|||||||
if (seg->list_size && seg->segment_count >= seg->list_size) {
|
if (seg->list_size && seg->segment_count >= seg->list_size) {
|
||||||
entry = seg->segment_list_entries;
|
entry = seg->segment_list_entries;
|
||||||
seg->segment_list_entries = seg->segment_list_entries->next;
|
seg->segment_list_entries = seg->segment_list_entries->next;
|
||||||
av_free(entry->filename);
|
av_freep(&entry->filename);
|
||||||
av_freep(&entry);
|
av_freep(&entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -501,10 +501,10 @@ static int open_null_ctx(AVIOContext **ctx)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void close_null_ctx(AVIOContext *pb)
|
static void close_null_ctxp(AVIOContext **pb)
|
||||||
{
|
{
|
||||||
av_free(pb->buffer);
|
av_freep(&(*pb)->buffer);
|
||||||
av_free(pb);
|
av_freep(pb);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int select_reference_stream(AVFormatContext *s)
|
static int select_reference_stream(AVFormatContext *s)
|
||||||
@ -687,7 +687,7 @@ static int seg_write_header(AVFormatContext *s)
|
|||||||
s->avoid_negative_ts = 1;
|
s->avoid_negative_ts = 1;
|
||||||
|
|
||||||
if (!seg->write_header_trailer) {
|
if (!seg->write_header_trailer) {
|
||||||
close_null_ctx(oc->pb);
|
close_null_ctxp(&oc->pb);
|
||||||
if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
|
if ((ret = avio_open2(&oc->pb, oc->filename, AVIO_FLAG_WRITE,
|
||||||
&s->interrupt_callback, NULL)) < 0)
|
&s->interrupt_callback, NULL)) < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
@ -820,7 +820,7 @@ static int seg_write_trailer(struct AVFormatContext *s)
|
|||||||
goto fail;
|
goto fail;
|
||||||
open_null_ctx(&oc->pb);
|
open_null_ctx(&oc->pb);
|
||||||
ret = av_write_trailer(oc);
|
ret = av_write_trailer(oc);
|
||||||
close_null_ctx(oc->pb);
|
close_null_ctxp(&oc->pb);
|
||||||
} else {
|
} else {
|
||||||
ret = segment_end(s, 1, 1);
|
ret = segment_end(s, 1, 1);
|
||||||
}
|
}
|
||||||
@ -836,7 +836,7 @@ fail:
|
|||||||
cur = seg->segment_list_entries;
|
cur = seg->segment_list_entries;
|
||||||
while (cur) {
|
while (cur) {
|
||||||
next = cur->next;
|
next = cur->next;
|
||||||
av_free(cur->filename);
|
av_freep(&cur->filename);
|
||||||
av_free(cur);
|
av_free(cur);
|
||||||
cur = next;
|
cur = next;
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
size = avio_rl32(s->pb) - 4;
|
size = avio_rl32(s->pb) - 4;
|
||||||
if (!size || size + 4L > frame_size) {
|
if (!size || size + 4LL > frame_size) {
|
||||||
av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
|
av_log(s, AV_LOG_ERROR, "Invalid audio part size\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
@ -184,6 +184,8 @@ static int thp_read_packet(AVFormatContext *s,
|
|||||||
pkt->stream_index = thp->video_stream_index;
|
pkt->stream_index = thp->video_stream_index;
|
||||||
} else {
|
} else {
|
||||||
ret = av_get_packet(pb, pkt, thp->audiosize);
|
ret = av_get_packet(pb, pkt, thp->audiosize);
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
if (ret != thp->audiosize) {
|
if (ret != thp->audiosize) {
|
||||||
av_free_packet(pkt);
|
av_free_packet(pkt);
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
|
@ -118,8 +118,10 @@ static int tta_read_header(AVFormatContext *s)
|
|||||||
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
|
ffio_init_checksum(s->pb, tta_check_crc, UINT32_MAX);
|
||||||
for (i = 0; i < c->totalframes; i++) {
|
for (i = 0; i < c->totalframes; i++) {
|
||||||
uint32_t size = avio_rl32(s->pb);
|
uint32_t size = avio_rl32(s->pb);
|
||||||
av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
int r;
|
||||||
AVINDEX_KEYFRAME);
|
if ((r = av_add_index_entry(st, framepos, i * c->frame_size, size, 0,
|
||||||
|
AVINDEX_KEYFRAME)) < 0)
|
||||||
|
return r;
|
||||||
framepos += size;
|
framepos += size;
|
||||||
}
|
}
|
||||||
crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
|
crc = ffio_get_checksum(s->pb) ^ UINT32_MAX;
|
||||||
@ -153,6 +155,11 @@ static int tta_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
if (c->currentframe >= c->totalframes)
|
if (c->currentframe >= c->totalframes)
|
||||||
return AVERROR_EOF;
|
return AVERROR_EOF;
|
||||||
|
|
||||||
|
if (st->nb_index_entries < c->totalframes) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "Index entry disappeared\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
size = st->index_entries[c->currentframe].size;
|
size = st->index_entries[c->currentframe].size;
|
||||||
|
|
||||||
ret = av_get_packet(s->pb, pkt, size);
|
ret = av_get_packet(s->pb, pkt, size);
|
||||||
|
@ -53,6 +53,9 @@
|
|||||||
#include "riff.h"
|
#include "riff.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_format_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file
|
* @file
|
||||||
* various utility functions for use within FFmpeg
|
* various utility functions for use within FFmpeg
|
||||||
@ -594,6 +597,8 @@ static int update_wrap_reference(AVFormatContext *s, AVStream *st, int stream_in
|
|||||||
int default_stream_index = av_find_default_stream_index(s);
|
int default_stream_index = av_find_default_stream_index(s);
|
||||||
if (s->streams[default_stream_index]->pts_wrap_reference == AV_NOPTS_VALUE) {
|
if (s->streams[default_stream_index]->pts_wrap_reference == AV_NOPTS_VALUE) {
|
||||||
for (i = 0; i < s->nb_streams; i++) {
|
for (i = 0; i < s->nb_streams; i++) {
|
||||||
|
if (av_find_program_from_stream(s, NULL, i))
|
||||||
|
continue;
|
||||||
s->streams[i]->pts_wrap_reference = pts_wrap_reference;
|
s->streams[i]->pts_wrap_reference = pts_wrap_reference;
|
||||||
s->streams[i]->pts_wrap_behavior = pts_wrap_behavior;
|
s->streams[i]->pts_wrap_behavior = pts_wrap_behavior;
|
||||||
}
|
}
|
||||||
@ -2807,8 +2812,8 @@ static int get_std_framerate(int i)
|
|||||||
* And there are "variable" fps files this needs to detect as well. */
|
* And there are "variable" fps files this needs to detect as well. */
|
||||||
static int tb_unreliable(AVCodecContext *c)
|
static int tb_unreliable(AVCodecContext *c)
|
||||||
{
|
{
|
||||||
if (c->time_base.den >= 101L * c->time_base.num ||
|
if (c->time_base.den >= 101LL * c->time_base.num ||
|
||||||
c->time_base.den < 5L * c->time_base.num ||
|
c->time_base.den < 5LL * c->time_base.num ||
|
||||||
// c->codec_tag == AV_RL32("DIVX") ||
|
// c->codec_tag == AV_RL32("DIVX") ||
|
||||||
// c->codec_tag == AV_RL32("XVID") ||
|
// c->codec_tag == AV_RL32("XVID") ||
|
||||||
c->codec_tag == AV_RL32("mp4v") ||
|
c->codec_tag == AV_RL32("mp4v") ||
|
||||||
@ -2824,6 +2829,7 @@ int ff_alloc_extradata(AVCodecContext *avctx, int size)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
if (size < 0 || size >= INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||||
|
avctx->extradata = NULL;
|
||||||
avctx->extradata_size = 0;
|
avctx->extradata_size = 0;
|
||||||
return AVERROR(EINVAL);
|
return AVERROR(EINVAL);
|
||||||
}
|
}
|
||||||
@ -3644,6 +3650,11 @@ AVStream *avformat_new_stream(AVFormatContext *s, const AVCodec *c)
|
|||||||
st->info->last_dts = AV_NOPTS_VALUE;
|
st->info->last_dts = AV_NOPTS_VALUE;
|
||||||
|
|
||||||
st->codec = avcodec_alloc_context3(c);
|
st->codec = avcodec_alloc_context3(c);
|
||||||
|
if (!st->codec) {
|
||||||
|
av_free(st->info);
|
||||||
|
av_free(st);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
if (s->iformat) {
|
if (s->iformat) {
|
||||||
/* no default bitrate if decoding */
|
/* no default bitrate if decoding */
|
||||||
st->codec->bit_rate = 0;
|
st->codec->bit_rate = 0;
|
||||||
|
@ -503,6 +503,7 @@ int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
|
|||||||
free_side_data(&dst->side_data[i]);
|
free_side_data(&dst->side_data[i]);
|
||||||
}
|
}
|
||||||
av_freep(&dst->side_data);
|
av_freep(&dst->side_data);
|
||||||
|
dst->nb_side_data = 0;
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
}
|
}
|
||||||
memcpy(sd_dst->data, sd_src->data, sd_src->size);
|
memcpy(sd_dst->data, sd_src->data, sd_src->size);
|
||||||
|
@ -32,11 +32,10 @@
|
|||||||
#ifndef LIBAVUTIL_OPENCL_H
|
#ifndef LIBAVUTIL_OPENCL_H
|
||||||
#define LIBAVUTIL_OPENCL_H
|
#define LIBAVUTIL_OPENCL_H
|
||||||
|
|
||||||
#include "config.h"
|
#ifdef __APPLE__
|
||||||
#if HAVE_CL_CL_H
|
|
||||||
#include <CL/cl.h>
|
|
||||||
#else
|
|
||||||
#include <OpenCL/cl.h>
|
#include <OpenCL/cl.h>
|
||||||
|
#else
|
||||||
|
#include <CL/cl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "dict.h"
|
#include "dict.h"
|
||||||
|
@ -65,8 +65,8 @@ static int read_number(const AVOption *o, const void *dst, double *num, int *den
|
|||||||
{
|
{
|
||||||
switch (o->type) {
|
switch (o->type) {
|
||||||
case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
|
case AV_OPT_TYPE_FLAGS: *intnum = *(unsigned int*)dst;return 0;
|
||||||
case AV_OPT_TYPE_PIXEL_FMT:
|
case AV_OPT_TYPE_PIXEL_FMT: *intnum = *(enum AVPixelFormat *)dst;return 0;
|
||||||
case AV_OPT_TYPE_SAMPLE_FMT:
|
case AV_OPT_TYPE_SAMPLE_FMT:*intnum = *(enum AVSampleFormat*)dst;return 0;
|
||||||
case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
|
case AV_OPT_TYPE_INT: *intnum = *(int *)dst;return 0;
|
||||||
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
||||||
case AV_OPT_TYPE_DURATION:
|
case AV_OPT_TYPE_DURATION:
|
||||||
@ -100,9 +100,9 @@ static int write_number(void *obj, const AVOption *o, void *dst, double num, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (o->type) {
|
switch (o->type) {
|
||||||
|
case AV_OPT_TYPE_PIXEL_FMT: *(enum AVPixelFormat *)dst = llrint(num/den) * intnum; break;
|
||||||
|
case AV_OPT_TYPE_SAMPLE_FMT:*(enum AVSampleFormat*)dst = llrint(num/den) * intnum; break;
|
||||||
case AV_OPT_TYPE_FLAGS:
|
case AV_OPT_TYPE_FLAGS:
|
||||||
case AV_OPT_TYPE_PIXEL_FMT:
|
|
||||||
case AV_OPT_TYPE_SAMPLE_FMT:
|
|
||||||
case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
|
case AV_OPT_TYPE_INT: *(int *)dst= llrint(num/den)*intnum; break;
|
||||||
case AV_OPT_TYPE_DURATION:
|
case AV_OPT_TYPE_DURATION:
|
||||||
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
case AV_OPT_TYPE_CHANNEL_LAYOUT:
|
||||||
@ -143,6 +143,8 @@ static int set_string_binary(void *obj, const AVOption *o, const char *val, uint
|
|||||||
len /= 2;
|
len /= 2;
|
||||||
|
|
||||||
ptr = bin = av_malloc(len);
|
ptr = bin = av_malloc(len);
|
||||||
|
if (!ptr)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
while (*val) {
|
while (*val) {
|
||||||
int a = hexchar2int(*val++);
|
int a = hexchar2int(*val++);
|
||||||
int b = hexchar2int(*val++);
|
int b = hexchar2int(*val++);
|
||||||
|
@ -27,6 +27,9 @@
|
|||||||
* various utility functions
|
* various utility functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char av_util_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
unsigned avutil_version(void)
|
unsigned avutil_version(void)
|
||||||
{
|
{
|
||||||
static int checks_done;
|
static int checks_done;
|
||||||
|
@ -89,6 +89,9 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
|
|||||||
#include "postprocess_internal.h"
|
#include "postprocess_internal.h"
|
||||||
#include "libavutil/avstring.h"
|
#include "libavutil/avstring.h"
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char postproc_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
unsigned postproc_version(void)
|
unsigned postproc_version(void)
|
||||||
{
|
{
|
||||||
av_assert0(LIBPOSTPROC_VERSION_MICRO >= 100);
|
av_assert0(LIBPOSTPROC_VERSION_MICRO >= 100);
|
||||||
|
@ -84,14 +84,14 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
|
|||||||
in_fmt = av_get_packed_sample_fmt( in_fmt);
|
in_fmt = av_get_packed_sample_fmt( in_fmt);
|
||||||
|
|
||||||
if(in_fmt == AV_SAMPLE_FMT_FLT || in_fmt == AV_SAMPLE_FMT_DBL){
|
if(in_fmt == AV_SAMPLE_FMT_FLT || in_fmt == AV_SAMPLE_FMT_DBL){
|
||||||
if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1L<<31);
|
if(out_fmt == AV_SAMPLE_FMT_S32) scale = 1.0/(1LL<<31);
|
||||||
if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1L<<15);
|
if(out_fmt == AV_SAMPLE_FMT_S16) scale = 1.0/(1LL<<15);
|
||||||
if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1L<< 7);
|
if(out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1.0/(1LL<< 7);
|
||||||
}
|
}
|
||||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S32 && (s->dither.output_sample_bits&31)) scale = 1;
|
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S32 && (s->dither.output_sample_bits&31)) scale = 1;
|
||||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1L<<16;
|
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_S16) scale = 1<<16;
|
||||||
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<24;
|
if(in_fmt == AV_SAMPLE_FMT_S32 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<24;
|
||||||
if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1L<<8;
|
if(in_fmt == AV_SAMPLE_FMT_S16 && out_fmt == AV_SAMPLE_FMT_U8 ) scale = 1<<8;
|
||||||
|
|
||||||
scale *= s->dither.scale;
|
scale *= s->dither.scale;
|
||||||
|
|
||||||
|
@ -76,8 +76,12 @@ static int process(
|
|||||||
AudioData *src, int src_size, int *consumed){
|
AudioData *src, int src_size, int *consumed){
|
||||||
size_t idone, odone;
|
size_t idone, odone;
|
||||||
soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count));
|
soxr_error_t error = soxr_set_error((soxr_t)c, soxr_set_num_channels((soxr_t)c, src->ch_count));
|
||||||
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
if (!error)
|
||||||
&idone, dst->ch, (size_t)dst_size, &odone);
|
error = soxr_process((soxr_t)c, src->ch, (size_t)src_size,
|
||||||
|
&idone, dst->ch, (size_t)dst_size, &odone);
|
||||||
|
else
|
||||||
|
idone = 0;
|
||||||
|
|
||||||
*consumed = (int)idone;
|
*consumed = (int)idone;
|
||||||
return error? -1 : odone;
|
return error? -1 : odone;
|
||||||
}
|
}
|
||||||
|
@ -28,6 +28,9 @@
|
|||||||
|
|
||||||
#define ALIGN 32
|
#define ALIGN 32
|
||||||
|
|
||||||
|
#include "libavutil/ffversion.h"
|
||||||
|
const char swr_ffversion[] = "FFmpeg version " FFMPEG_VERSION;
|
||||||
|
|
||||||
unsigned swresample_version(void)
|
unsigned swresample_version(void)
|
||||||
{
|
{
|
||||||
av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
|
av_assert0(LIBSWRESAMPLE_VERSION_MICRO >= 100);
|
||||||
|
@ -221,6 +221,8 @@ cglobal pack_6ch_%2_to_%1_%3, 2,8,7, dst, src, src1, src2, src3, src4, src5, len
|
|||||||
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
||||||
test srcq, mmsize-1
|
test srcq, mmsize-1
|
||||||
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
||||||
|
test src1q, mmsize-1
|
||||||
|
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
||||||
test src2q, mmsize-1
|
test src2q, mmsize-1
|
||||||
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
jne pack_6ch_%2_to_%1_u_int %+ SUFFIX
|
||||||
test src3q, mmsize-1
|
test src3q, mmsize-1
|
||||||
|
@ -412,14 +412,24 @@ static void gbr24pToUV_half_c(uint8_t *_dstU, uint8_t *_dstV,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rgba64ToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
|
static void rgba64leToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
|
||||||
const uint8_t *unused2, int width, uint32_t *unused)
|
const uint8_t *unused2, int width, uint32_t *unused)
|
||||||
{
|
{
|
||||||
int16_t *dst = (int16_t *)_dst;
|
int16_t *dst = (int16_t *)_dst;
|
||||||
const uint16_t *src = (const uint16_t *)_src;
|
const uint16_t *src = (const uint16_t *)_src;
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < width; i++)
|
for (i = 0; i < width; i++)
|
||||||
dst[i] = src[4 * i + 3];
|
dst[i] = AV_RL16(src + 4 * i + 3);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void rgba64beToA_c(uint8_t *_dst, const uint8_t *_src, const uint8_t *unused1,
|
||||||
|
const uint8_t *unused2, int width, uint32_t *unused)
|
||||||
|
{
|
||||||
|
int16_t *dst = (int16_t *)_dst;
|
||||||
|
const uint16_t *src = (const uint16_t *)_src;
|
||||||
|
int i;
|
||||||
|
for (i = 0; i < width; i++)
|
||||||
|
dst[i] = AV_RB16(src + 4 * i + 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused)
|
static void abgrToA_c(uint8_t *_dst, const uint8_t *src, const uint8_t *unused1, const uint8_t *unused2, int width, uint32_t *unused)
|
||||||
@ -1249,11 +1259,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
|
|||||||
#endif
|
#endif
|
||||||
case AV_PIX_FMT_YA16LE:
|
case AV_PIX_FMT_YA16LE:
|
||||||
c->lumToYV12 = read_ya16le_gray_c;
|
c->lumToYV12 = read_ya16le_gray_c;
|
||||||
c->alpToYV12 = read_ya16le_alpha_c;
|
|
||||||
break;
|
break;
|
||||||
case AV_PIX_FMT_YA16BE:
|
case AV_PIX_FMT_YA16BE:
|
||||||
c->lumToYV12 = read_ya16be_gray_c;
|
c->lumToYV12 = read_ya16be_gray_c;
|
||||||
c->alpToYV12 = read_ya16be_alpha_c;
|
|
||||||
break;
|
break;
|
||||||
case AV_PIX_FMT_YUYV422:
|
case AV_PIX_FMT_YUYV422:
|
||||||
case AV_PIX_FMT_YVYU422:
|
case AV_PIX_FMT_YVYU422:
|
||||||
@ -1361,9 +1369,9 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
|
|||||||
}
|
}
|
||||||
switch (srcFormat) {
|
switch (srcFormat) {
|
||||||
case AV_PIX_FMT_BGRA64LE:
|
case AV_PIX_FMT_BGRA64LE:
|
||||||
|
case AV_PIX_FMT_RGBA64LE: c->alpToYV12 = rgba64leToA_c; break;
|
||||||
case AV_PIX_FMT_BGRA64BE:
|
case AV_PIX_FMT_BGRA64BE:
|
||||||
case AV_PIX_FMT_RGBA64LE:
|
case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64beToA_c; break;
|
||||||
case AV_PIX_FMT_RGBA64BE: c->alpToYV12 = rgba64ToA_c; break;
|
|
||||||
case AV_PIX_FMT_BGRA:
|
case AV_PIX_FMT_BGRA:
|
||||||
case AV_PIX_FMT_RGBA:
|
case AV_PIX_FMT_RGBA:
|
||||||
c->alpToYV12 = rgbaToA_c;
|
c->alpToYV12 = rgbaToA_c;
|
||||||
@ -1375,6 +1383,12 @@ av_cold void ff_sws_init_input_funcs(SwsContext *c)
|
|||||||
case AV_PIX_FMT_YA8:
|
case AV_PIX_FMT_YA8:
|
||||||
c->alpToYV12 = uyvyToY_c;
|
c->alpToYV12 = uyvyToY_c;
|
||||||
break;
|
break;
|
||||||
|
case AV_PIX_FMT_YA16LE:
|
||||||
|
c->alpToYV12 = read_ya16le_alpha_c;
|
||||||
|
break;
|
||||||
|
case AV_PIX_FMT_YA16BE:
|
||||||
|
c->alpToYV12 = read_ya16be_alpha_c;
|
||||||
|
break;
|
||||||
case AV_PIX_FMT_PAL8 :
|
case AV_PIX_FMT_PAL8 :
|
||||||
c->alpToYV12 = palToA_c;
|
c->alpToYV12 = palToA_c;
|
||||||
break;
|
break;
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
|
#define STR(s) AV_TOSTRING(s) // AV_STRINGIFY is too long
|
||||||
|
|
||||||
#define YUVRGB_TABLE_HEADROOM 128
|
#define YUVRGB_TABLE_HEADROOM 256
|
||||||
|
|
||||||
#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
|
#define MAX_FILTER_SIZE SWS_MAX_FILTER_SIZE
|
||||||
|
|
||||||
|
@ -611,14 +611,15 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((*filterPos)[i] + filterSize > srcW) {
|
if ((*filterPos)[i] + filterSize > srcW) {
|
||||||
int shift = (*filterPos)[i] + filterSize - srcW;
|
int shift = (*filterPos)[i] + FFMIN(filterSize - srcW, 0);
|
||||||
|
|
||||||
// move filter coefficients right to compensate for filterPos
|
// move filter coefficients right to compensate for filterPos
|
||||||
for (j = filterSize - 2; j >= 0; j--) {
|
for (j = filterSize - 2; j >= 0; j--) {
|
||||||
int right = FFMIN(j + shift, filterSize - 1);
|
int right = FFMIN(j + shift, filterSize - 1);
|
||||||
filter[i * filterSize + right] += filter[i * filterSize + j];
|
filter[i * filterSize + right] += filter[i * filterSize + j];
|
||||||
filter[i * filterSize + j] = 0;
|
filter[i * filterSize + j] = 0;
|
||||||
}
|
}
|
||||||
(*filterPos)[i]= srcW - filterSize;
|
(*filterPos)[i]-= shift;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -771,9 +771,13 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
|
|
||||||
av_freep(&c->yuvTable);
|
av_freep(&c->yuvTable);
|
||||||
|
|
||||||
|
#define ALLOC_YUV_TABLE(x) \
|
||||||
|
c->yuvTable = av_malloc(x); \
|
||||||
|
if (!c->yuvTable) \
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
switch (bpp) {
|
switch (bpp) {
|
||||||
case 1:
|
case 1:
|
||||||
c->yuvTable = av_malloc(1024);
|
ALLOC_YUV_TABLE(1024);
|
||||||
y_table = c->yuvTable;
|
y_table = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024 - 110; i++) {
|
for (i = 0; i < 1024 - 110; i++) {
|
||||||
@ -788,7 +792,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
rbase = isRgb ? 3 : 0;
|
rbase = isRgb ? 3 : 0;
|
||||||
gbase = 1;
|
gbase = 1;
|
||||||
bbase = isRgb ? 0 : 3;
|
bbase = isRgb ? 0 : 3;
|
||||||
c->yuvTable = av_malloc(1024 * 3);
|
ALLOC_YUV_TABLE(1024 * 3);
|
||||||
y_table = c->yuvTable;
|
y_table = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024 - 110; i++) {
|
for (i = 0; i < 1024 - 110; i++) {
|
||||||
@ -807,7 +811,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
rbase = isRgb ? 5 : 0;
|
rbase = isRgb ? 5 : 0;
|
||||||
gbase = isRgb ? 2 : 3;
|
gbase = isRgb ? 2 : 3;
|
||||||
bbase = isRgb ? 0 : 6;
|
bbase = isRgb ? 0 : 6;
|
||||||
c->yuvTable = av_malloc(1024 * 3);
|
ALLOC_YUV_TABLE(1024 * 3);
|
||||||
y_table = c->yuvTable;
|
y_table = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024 - 38; i++) {
|
for (i = 0; i < 1024 - 38; i++) {
|
||||||
@ -826,7 +830,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
rbase = isRgb ? 8 : 0;
|
rbase = isRgb ? 8 : 0;
|
||||||
gbase = 4;
|
gbase = 4;
|
||||||
bbase = isRgb ? 0 : 8;
|
bbase = isRgb ? 0 : 8;
|
||||||
c->yuvTable = av_malloc(1024 * 3 * 2);
|
ALLOC_YUV_TABLE(1024 * 3 * 2);
|
||||||
y_table16 = c->yuvTable;
|
y_table16 = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024; i++) {
|
for (i = 0; i < 1024; i++) {
|
||||||
@ -849,7 +853,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
rbase = isRgb ? bpp - 5 : 0;
|
rbase = isRgb ? bpp - 5 : 0;
|
||||||
gbase = 5;
|
gbase = 5;
|
||||||
bbase = isRgb ? 0 : (bpp - 5);
|
bbase = isRgb ? 0 : (bpp - 5);
|
||||||
c->yuvTable = av_malloc(1024 * 3 * 2);
|
ALLOC_YUV_TABLE(1024 * 3 * 2);
|
||||||
y_table16 = c->yuvTable;
|
y_table16 = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024; i++) {
|
for (i = 0; i < 1024; i++) {
|
||||||
@ -869,7 +873,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
break;
|
break;
|
||||||
case 24:
|
case 24:
|
||||||
case 48:
|
case 48:
|
||||||
c->yuvTable = av_malloc(1024);
|
ALLOC_YUV_TABLE(1024);
|
||||||
y_table = c->yuvTable;
|
y_table = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024; i++) {
|
for (i = 0; i < 1024; i++) {
|
||||||
@ -891,7 +895,7 @@ av_cold int ff_yuv2rgb_c_init_tables(SwsContext *c, const int inv_table[4],
|
|||||||
needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
|
needAlpha = CONFIG_SWSCALE_ALPHA && isALPHA(c->srcFormat);
|
||||||
if (!needAlpha)
|
if (!needAlpha)
|
||||||
abase = (base + 24) & 31;
|
abase = (base + 24) & 31;
|
||||||
c->yuvTable = av_malloc(1024 * 3 * 4);
|
ALLOC_YUV_TABLE(1024 * 3 * 4);
|
||||||
y_table32 = c->yuvTable;
|
y_table32 = c->yuvTable;
|
||||||
yb = -(384 << 16) - oy;
|
yb = -(384 << 16) - oy;
|
||||||
for (i = 0; i < 1024; i++) {
|
for (i = 0; i < 1024; i++) {
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
#tb 0: 1/25
|
#tb 0: 1/50
|
||||||
0, 0, 0, 1, 152064, 0x05b789ef
|
0, 0, 0, 1, 152064, 0x05b789ef
|
||||||
0, 1, 1, 1, 152064, 0x05b789ef
|
0, 1, 1, 1, 152064, 0x05b789ef
|
||||||
0, 2, 2, 1, 152064, 0x4bb46551
|
0, 2, 2, 1, 152064, 0x4bb46551
|
||||||
0, 3, 3, 1, 152064, 0x9dddf64a
|
0, 3, 3, 1, 152064, 0x4bb46551
|
||||||
0, 4, 4, 1, 152064, 0x2a8380b0
|
0, 4, 4, 1, 152064, 0x9dddf64a
|
||||||
0, 5, 5, 1, 152064, 0x4de3b652
|
0, 5, 5, 1, 152064, 0x9dddf64a
|
||||||
0, 6, 6, 1, 152064, 0xedb5a8e6
|
0, 6, 6, 1, 152064, 0x2a8380b0
|
||||||
0, 7, 7, 1, 152064, 0xe20f7c23
|
0, 7, 7, 1, 152064, 0x2a8380b0
|
||||||
0, 8, 8, 1, 152064, 0x5ab58bac
|
0, 8, 8, 1, 152064, 0x4de3b652
|
||||||
0, 9, 9, 1, 152064, 0x1f1b8026
|
0, 9, 9, 1, 152064, 0x4de3b652
|
||||||
0, 10, 10, 1, 152064, 0x91373915
|
0, 10, 10, 1, 152064, 0xedb5a8e6
|
||||||
0, 11, 11, 1, 152064, 0x02344760
|
0, 11, 11, 1, 152064, 0xedb5a8e6
|
||||||
0, 12, 12, 1, 152064, 0x30f5fcd5
|
0, 12, 12, 1, 152064, 0xe20f7c23
|
||||||
0, 13, 13, 1, 152064, 0xc711ad61
|
0, 13, 13, 1, 152064, 0xe20f7c23
|
||||||
0, 14, 14, 1, 152064, 0x24eca223
|
0, 14, 14, 1, 152064, 0x5ab58bac
|
||||||
|
Loading…
x
Reference in New Issue
Block a user