Compare commits
106 Commits
master
...
release/3.
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b62191f9c1 | ||
![]() |
21c36d83f8 | ||
![]() |
4774eb8128 | ||
![]() |
96f5019bde | ||
![]() |
bffe1c4222 | ||
![]() |
fbdf5ca763 | ||
![]() |
c6470d8193 | ||
![]() |
e5942c1436 | ||
![]() |
dab82a2a7c | ||
![]() |
7f864badc0 | ||
![]() |
cc1e01d8b6 | ||
![]() |
69c3dfdd54 | ||
![]() |
241f1e603f | ||
![]() |
4d9fdca053 | ||
![]() |
b11900251f | ||
![]() |
145b18ce9a | ||
![]() |
e5d167149d | ||
![]() |
ed71759fd0 | ||
![]() |
d7ae13d479 | ||
![]() |
1cd872a7d5 | ||
![]() |
f6586db165 | ||
![]() |
7c43c48fda | ||
![]() |
069eea16d9 | ||
![]() |
79181b97d4 | ||
![]() |
46360e36d9 | ||
![]() |
ef2b8416d9 | ||
![]() |
9491f47035 | ||
![]() |
2fc7e5c1b5 | ||
![]() |
68dcb46205 | ||
![]() |
8dce66d33d | ||
![]() |
08c21bcb5d | ||
![]() |
e675926a4f | ||
![]() |
c66f4d1ae6 | ||
![]() |
ad559492dc | ||
![]() |
8d0cfa68b9 | ||
![]() |
83eaaae005 | ||
![]() |
a5638dbfba | ||
![]() |
666754c665 | ||
![]() |
4c896d6bd4 | ||
![]() |
f2e9e4757f | ||
![]() |
512c064cd9 | ||
![]() |
7626fb6cbf | ||
![]() |
6fdd122b11 | ||
![]() |
264c9fe6aa | ||
![]() |
76573c5239 | ||
![]() |
14fdebc4ff | ||
![]() |
325d0b64d5 | ||
![]() |
6103a8453f | ||
![]() |
47f0d80ee0 | ||
![]() |
5d79566ab3 | ||
![]() |
fda00aa774 | ||
![]() |
9b1b674ebe | ||
![]() |
00b54d4625 | ||
![]() |
26d29f0c3d | ||
![]() |
7b1e020fc5 | ||
![]() |
3d9ebfd272 | ||
![]() |
f01919b57a | ||
![]() |
6cb5bbc660 | ||
![]() |
f281cb4ea9 | ||
![]() |
b176ab0556 | ||
![]() |
1cbe4ff2ac | ||
![]() |
7c2576e15d | ||
![]() |
526c7b2186 | ||
![]() |
2d0e415482 | ||
![]() |
daa6dc0a3b | ||
![]() |
6e5648ad42 | ||
![]() |
e15a48d35a | ||
![]() |
0fae52d7e3 | ||
![]() |
50a639a62a | ||
![]() |
d6adcab842 | ||
![]() |
bf80b1d88d | ||
![]() |
53fffc9fc4 | ||
![]() |
b0e836466f | ||
![]() |
e158936712 | ||
![]() |
c8977ec6e9 | ||
![]() |
934bc32acc | ||
![]() |
64f2b48be0 | ||
![]() |
756f4b586a | ||
![]() |
56c4dca5ae | ||
![]() |
da6ccfe18e | ||
![]() |
27a61302b7 | ||
![]() |
b4be953c55 | ||
![]() |
3b179b6302 | ||
![]() |
bf8f2fae2a | ||
![]() |
0d7343f8dd | ||
![]() |
fb8676eb1c | ||
![]() |
ca5c639446 | ||
![]() |
bd79dbfa2b | ||
![]() |
c4765a41b9 | ||
![]() |
be5acd6cb1 | ||
![]() |
c3e7a7ef3f | ||
![]() |
9e4d297ba7 | ||
![]() |
373bc77a35 | ||
![]() |
20d89a3a32 | ||
![]() |
ee7c347935 | ||
![]() |
9da31a0373 | ||
![]() |
eb46065f4a | ||
![]() |
b80083a5c1 | ||
![]() |
449ff0e3fd | ||
![]() |
0aa2fbddb1 | ||
![]() |
c40983a6f6 | ||
![]() |
bd0497b28b | ||
![]() |
4d95207938 | ||
![]() |
1e8a75fae4 | ||
![]() |
380980e0d2 | ||
![]() |
1fd8eb4d4f |
ChangelogMAINTAINERSRELEASERELEASE_NOTESconfigure
doc
ffmpeg.cffplay.cffserver.clibavcodec
aacenc_utils.hac3dec.capedec.cavpacket.cbmp_parser.ccfhd.cdca_core.cdiracdec.ch264.ch264_picture.ch264_slice.chevc.chevc.hhevc_parse.chevc_parser.chevc_sei.cindeo2.cindeo2data.hj2kenc.clibopenjpegenc.clibutvideodec.cpplibwebpenc_animencoder.c
mips
aaccoder_mips.caacdec_mips.haacpsdsp_mips.caacpsy_mips.haacsbr_mips.caacsbr_mips.hac3dsp_mips.cacelp_filters_mips.cacelp_vectors_mips.camrwbdec_mips.camrwbdec_mips.hcelp_filters_mips.ccelp_math_mips.ccompute_antialias_float.hfft_mips.ciirfilter_mips.clsp_mips.hmpegaudiodsp_mips_fixed.cmpegaudiodsp_mips_float.csbrdsp_mips.c
mjpegdec.cmjpegenc_common.cmpegvideo.cpgssubdec.cpngdec.cresample.crscc.ctakdec.cttaenc.cvc2enc.cx86
libavfilter
libavformat
avidec.ccache.cconcatdec.cffmdec.cfile.chlsenc.chttp.clibrtmp.cmov.cmpegts.cmpegtsenc.cmux.coggdec.coggparseopus.coggparsevp8.coptions_table.hrtpdec_jpeg.crtpenc.csvag.cutils.c
libavutil
64
Changelog
64
Changelog
@ -1,7 +1,67 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
|
||||
version 3.0.2:
|
||||
- avcodec/ttaenc: Reallocate packet if its too small
|
||||
- configure: build fix for P5600 with mips code restructuring
|
||||
- mips: add support for R6
|
||||
- pgssubdec: fix subpicture output colorspace and range
|
||||
- avcodec/ac3dec: Reset SPX when switching from EAC3 to AC3
|
||||
- avfilter/vf_drawtext: Check return code of load_glyph()
|
||||
- avformat/mux: Check that deinit is set before calling it
|
||||
- avcodec/takdec: add code that got somehow lost in process of REing
|
||||
- avcodec/apedec: fix decoding of stereo files with one channel full of silence
|
||||
- avcodec/avpacket: Fix off by 5 error
|
||||
- avcodec/h264: Fix for H.264 configuration parsing
|
||||
- avcodec/bmp_parser: Ensure remaining_size is not too small in startcode packet crossing corner case
|
||||
- avcodec/pngdec: Fix alpha detection with skip_frame
|
||||
- Changelog: Make formating consistent
|
||||
- avfilter/src_movie: fix how we check for overflows with seek_point
|
||||
- avcodec/j2kenc: Add attribution to OpenJPEG project:
|
||||
|
||||
|
||||
version 3.0.1:
|
||||
- avcodec/libutvideodec: copy frame so it has reference counters when refcounted_frames is set
|
||||
- avformat/rtpdec_jpeg: fix low contrast image on low quality setting
|
||||
- avformat/mpegtsenc: Fix used service
|
||||
- avformat/mpegtsenc: Keep track of the program for each service
|
||||
- avformat/file: Add crypto to default whitelist
|
||||
- avcodec/mjpegenc_common: Store approximate aspect if exact cannot be stored
|
||||
- lavc/hevc: Allow arbitrary garbage in bytestream as long as at least one NAL unit is found.
|
||||
- avcodec/resample: Remove disabled and faulty code
|
||||
- indeo2: Fix banding artefacts
|
||||
- indeo2data: K&R formatting cosmetics
|
||||
- avformat/hlsenc: Fix passing options, regression since bc9a5965c815cf7fd998d8ce14a18b8e861dd9ce
|
||||
- avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
|
||||
- avutil/channel_layout: AV_CH_LAYOUT_6POINT1_BACK not reachable in parsing
|
||||
- avformat/concatdec: set safe mode to enabled instead of auto
|
||||
- avformat/utils: fix dts from pts code in compute_pkt_fields() during ascending delay
|
||||
- avformat/rtpenc: Fix integer overflow in NTP_TO_RTP_FORMAT
|
||||
- avcodec/dca: clear X96 channels if nothing was decoded
|
||||
- fate/aac: Increase fuzz from of fate-aac-pns-encode from 72 to 74 for Loongson
|
||||
- avformat/cache: Fix memleak of tree entries
|
||||
- lavf/mov: downgrade sidx errors to non-fatal warnings; fixes trac #5216
|
||||
- lavf/mov: fix sidx with edit lists
|
||||
- avcodec/mjpegdec: Fix decoding slightly odd progressive jpeg
|
||||
- swscale/utils: Fix chrSrcHSubSample for GBRAP16
|
||||
- swscale/input: Fix GBRAP16 input
|
||||
- avutil/pixdesc: Make get_color_type() aware of CIE XYZ formats
|
||||
- avcodec/h264: Execute error concealment before marking the frame as done.
|
||||
- swscale/x86/output: Fix yuv2planeX_16* with unaligned destination
|
||||
- swscale/x86/output: Move code into yuv2planeX_mainloop
|
||||
- MAINTAINERS: add myself as an OS/2 maintainer
|
||||
- libwebpenc_animencoder: print library messages in verbose log levels
|
||||
- libwebpenc_animencoder: zero initialize the WebPAnimEncoderOptions struct
|
||||
- configure: check for SEC_I_CONTEXT_EXPIRED before enabling SChannel
|
||||
- lavf/http: Add httpproxy to the default protocol whitelist.
|
||||
- doc/utils: fix typo for min() description
|
||||
- ffserver&ffm: Fixed issues preventing ffserver write_index and files_size from being set correctly which was breaking ffserver streaming.
|
||||
- postproc: fix unaligned access
|
||||
- vc2enc: fix use of uninitialized variables in the rate control system, correctly zero out coefficient array padding
|
||||
- aacenc: optimize encoding speed
|
||||
- avcodec/diracdec: check bitstream size related fields for overflows
|
||||
- avcodec/h264_slice: Check PPS more extensively when its not copied
|
||||
|
||||
|
||||
version 3.0:
|
||||
@ -70,6 +130,8 @@ version 3.0:
|
||||
- streamselect video and astreamselect audio filter
|
||||
- swaprect filter
|
||||
- metadata video and ametadata audio filter
|
||||
- SMPTE VC-2 HQ profile support for the Dirac decoder
|
||||
- SMPTE VC-2 native encoder supporting the HQ profile
|
||||
|
||||
|
||||
version 2.8:
|
||||
|
@ -564,6 +564,7 @@ Windows ICL Matthew Oliver
|
||||
ADI/Blackfin DSP Marc Hoffman
|
||||
Sparc Roman Shaposhnik
|
||||
x86 Michael Niedermayer
|
||||
OS/2 KO Myung-Hun
|
||||
|
||||
|
||||
Releases
|
||||
|
2
RELEASE
2
RELEASE
@ -1 +1 @@
|
||||
2.8.git
|
||||
3.0.2
|
||||
|
15
RELEASE_NOTES
Normal file
15
RELEASE_NOTES
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
┌─────────────────────────────────────────┐
|
||||
│ RELEASE NOTES for FFmpeg 3.0 "Einstein" │
|
||||
└─────────────────────────────────────────┘
|
||||
|
||||
The FFmpeg Project proudly presents FFmpeg 3.0 "Einstein", about 5
|
||||
months after the release of FFmpeg 2.8.
|
||||
|
||||
A complete Changelog is available at the root of the project, and the
|
||||
complete Git history on http://source.ffmpeg.org.
|
||||
|
||||
We hope you will like this release as much as we enjoyed working on it, and
|
||||
as usual, if you have any questions about it, or any FFmpeg related topic,
|
||||
feel free to join us on the #ffmpeg IRC channel (on irc.freenode.net) or ask
|
||||
on the mailing-lists.
|
260
configure
vendored
260
configure
vendored
@ -913,6 +913,25 @@ void foo(void){ __asm__ volatile($code); }
|
||||
EOF
|
||||
}
|
||||
|
||||
check_inline_asm_flags(){
|
||||
log check_inline_asm_flags "$@"
|
||||
name="$1"
|
||||
code="$2"
|
||||
flags=''
|
||||
shift 2
|
||||
while [ "$1" != "" ]; do
|
||||
append flags $1
|
||||
shift
|
||||
done;
|
||||
disable $name
|
||||
cat > $TMPC <<EOF
|
||||
void foo(void){ __asm__ volatile($code); }
|
||||
EOF
|
||||
log_file $TMPC
|
||||
check_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
|
||||
enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
|
||||
}
|
||||
|
||||
check_insn(){
|
||||
log check_insn "$@"
|
||||
check_inline_asm ${1}_inline "\"$2\""
|
||||
@ -1657,6 +1676,7 @@ ARCH_EXT_LIST_ARM="
|
||||
ARCH_EXT_LIST_MIPS="
|
||||
mipsfpu
|
||||
mips32r2
|
||||
mips32r5
|
||||
mips64r2
|
||||
mips32r6
|
||||
mips64r6
|
||||
@ -2150,10 +2170,11 @@ mipsfpu_deps="mips"
|
||||
mipsdsp_deps="mips"
|
||||
mipsdspr2_deps="mips"
|
||||
mips32r2_deps="mips"
|
||||
mips32r5_deps="mips"
|
||||
mips32r6_deps="mips"
|
||||
mips64r2_deps="mips"
|
||||
mips64r6_deps="mips"
|
||||
msa_deps="mips"
|
||||
msa_deps="mipsfpu"
|
||||
mmi_deps="mips"
|
||||
|
||||
altivec_deps="ppc"
|
||||
@ -4153,118 +4174,90 @@ elif enabled mips; then
|
||||
|
||||
cpuflags="-march=$cpu"
|
||||
|
||||
case $cpu in
|
||||
24kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kf*)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kec|34kc|1004kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
24kef*|34kf*|1004kf*)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
74kc)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable msa
|
||||
;;
|
||||
74kf)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable msa
|
||||
;;
|
||||
p5600)
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
check_cflags "-mtune=p5600" &&
|
||||
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
|
||||
add_asflags "-mfp64"
|
||||
;;
|
||||
i6400)
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
check_cflags "-mtune=i6400 -mabi=64" &&
|
||||
check_cflags "-mfp64 -msched-weight -mload-store-pairs -funroll-loops" &&
|
||||
check_ldflags "-mabi=64" &&
|
||||
add_asflags "-mfp64"
|
||||
;;
|
||||
loongson*)
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
enable local_aligned_8 local_aligned_16 local_aligned_32
|
||||
enable simd_align_16
|
||||
enable fast_64bit
|
||||
enable fast_clz
|
||||
enable fast_cmov
|
||||
enable fast_unaligned
|
||||
disable aligned_stack
|
||||
case $cpu in
|
||||
loongson3*)
|
||||
cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2e)
|
||||
cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2f)
|
||||
cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
generic)
|
||||
disable mips64r6
|
||||
disable msa
|
||||
;;
|
||||
*)
|
||||
# Unknown CPU. Disable everything.
|
||||
warn "unknown CPU. Disabling all MIPS optimizations."
|
||||
disable mipsfpu
|
||||
disable mips32r2
|
||||
disable mips32r6
|
||||
disable mips64r2
|
||||
disable mips64r6
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
;;
|
||||
esac
|
||||
if [ "$cpu" != "generic" ]; then
|
||||
disable mips32r2
|
||||
disable mips32r5
|
||||
disable mips64r2
|
||||
disable mips32r6
|
||||
disable mips64r6
|
||||
disable loongson2
|
||||
disable loongson3
|
||||
|
||||
case $cpu in
|
||||
24kc|24kf*|24kec|34kc|1004kc|24kef*|34kf*|1004kf*|74kc|74kf)
|
||||
enable mips32r2
|
||||
disable msa
|
||||
;;
|
||||
p5600|i6400)
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
loongson*)
|
||||
enable loongson2
|
||||
enable loongson3
|
||||
enable local_aligned_8 local_aligned_16 local_aligned_32
|
||||
enable simd_align_16
|
||||
enable fast_64bit
|
||||
enable fast_clz
|
||||
enable fast_cmov
|
||||
enable fast_unaligned
|
||||
disable aligned_stack
|
||||
case $cpu in
|
||||
loongson3*)
|
||||
cpuflags="-march=loongson3a -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2e)
|
||||
cpuflags="-march=loongson2e -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
loongson2f)
|
||||
cpuflags="-march=loongson2f -mhard-float -fno-expensive-optimizations"
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
# Unknown CPU. Disable everything.
|
||||
warn "unknown CPU. Disabling all MIPS optimizations."
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
disable msa
|
||||
disable mmi
|
||||
;;
|
||||
esac
|
||||
|
||||
case $cpu in
|
||||
24kc)
|
||||
disable mipsfpu
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kf*)
|
||||
disable mipsdsp
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kec|34kc|1004kc)
|
||||
disable mipsfpu
|
||||
disable mipsdspr2
|
||||
;;
|
||||
24kef*|34kf*|1004kf*)
|
||||
disable mipsdspr2
|
||||
;;
|
||||
74kc)
|
||||
disable mipsfpu
|
||||
;;
|
||||
p5600)
|
||||
enable mips32r5
|
||||
check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
|
||||
;;
|
||||
i6400)
|
||||
enable mips64r6
|
||||
check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
|
||||
;;
|
||||
esac
|
||||
else
|
||||
# We do not disable anything. Is up to the user to disable the unwanted features.
|
||||
warn 'generic cpu selected'
|
||||
fi
|
||||
|
||||
elif enabled ppc; then
|
||||
|
||||
@ -5073,27 +5066,22 @@ elif enabled mips; then
|
||||
enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
|
||||
|
||||
# Enable minimum ISA based on selected options
|
||||
if enabled mips64 && (enabled mipsdsp || enabled mipsdspr2); then
|
||||
add_cflags "-mips64r2"
|
||||
add_asflags "-mips64r2"
|
||||
elif enabled mips64 && enabled mipsfpu && disabled loongson2 && disabled loongson3; then
|
||||
add_cflags "-mips64"
|
||||
add_asflags "-mips64"
|
||||
elif enabled mipsdsp || enabled mipsdspr2; then
|
||||
add_cflags "-mips32r2 -mfp32"
|
||||
add_asflags "-mips32r2 -mfp32"
|
||||
if enabled mips64; then
|
||||
enabled mips64r6 && check_inline_asm_flags mips64r6 '"dlsa $0, $0, $0, 1"' '-mips64r6'
|
||||
enabled mips64r2 && check_inline_asm_flags mips64r2 '"dext $0, $0, 0, 1"' '-mips64r2'
|
||||
disabled mips64r6 && disabled mips64r2 && check_inline_asm_flags mips64r1 '"daddi $0, $0, 0"' '-mips64'
|
||||
else
|
||||
enabled mips32r6 && check_inline_asm_flags mips32r6 '"aui $0, $0, 0"' '-mips32r6'
|
||||
enabled mips32r5 && check_inline_asm_flags mips32r5 '"eretnc"' '-mips32r5'
|
||||
enabled mips32r2 && check_inline_asm_flags mips32r2 '"ext $0, $0, 0, 1"' '-mips32r2'
|
||||
disabled mips32r6 && disabled mips32r5 && disabled mips32r2 && check_inline_asm_flags mips32r1 '"addi $0, $0, 0"' '-mips32'
|
||||
fi
|
||||
|
||||
enabled mipsdsp && add_cflags "-mdsp" && add_asflags "-mdsp" &&
|
||||
check_inline_asm mipsdsp '"addu.qb $t0, $t1, $t2"'
|
||||
enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
|
||||
check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
|
||||
enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
|
||||
check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
|
||||
enabled msa && check_cflags "-mmsa" && check_ldflags "-mmsa" &&
|
||||
check_inline_asm msa '"addvi.b $w0, $w1, 1"'
|
||||
|
||||
enabled msa && add_asflags "-mmsa"
|
||||
enabled mipsfpu && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f2"' '-mhard-float'
|
||||
enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
|
||||
enabled mipsfpu && enabled msa && check_inline_asm_flags msa '"addvi.b $w0, $w1, 1"' '-mmsa' && check_header msa.h || disable msa
|
||||
enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
|
||||
enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
|
||||
|
||||
elif enabled parisc; then
|
||||
|
||||
@ -5659,7 +5647,7 @@ disabled securetransport || { check_func SecIdentityCreate "-Wl,-framework,CoreF
|
||||
enable securetransport; }
|
||||
|
||||
disabled schannel || { check_func_headers "windows.h Security.h" InitializeSecurityContext -DSECURITY_WIN32 -lSecur32 &&
|
||||
enable schannel && add_extralibs -lSecur32; }
|
||||
check_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" && enable schannel && add_extralibs -lSecur32; }
|
||||
|
||||
makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
|
||||
enabled makeinfo \
|
||||
@ -5935,11 +5923,7 @@ elif enabled ccc; then
|
||||
add_cflags -msg_disable nonstandcast
|
||||
add_cflags -msg_disable unsupieee
|
||||
elif enabled gcc; then
|
||||
case $gcc_basever in
|
||||
4.9*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
4.*) check_optflags -fno-tree-vectorize ;;
|
||||
*) enabled x86 || check_optflags -fno-tree-vectorize ;;
|
||||
esac
|
||||
check_optflags -fno-tree-vectorize
|
||||
check_cflags -Werror=format-security
|
||||
check_cflags -Werror=implicit-function-declaration
|
||||
check_cflags -Werror=missing-prototypes
|
||||
|
@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
||||
# This could be handy for archiving the generated documentation or
|
||||
# if some version control system is used.
|
||||
|
||||
PROJECT_NUMBER =
|
||||
PROJECT_NUMBER = 3.0.2
|
||||
|
||||
# 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
|
||||
|
@ -104,7 +104,7 @@ All subsequent file-related directives apply to that file.
|
||||
|
||||
@item @code{ffconcat version 1.0}
|
||||
Identify the script type and version. It also sets the @option{safe} option
|
||||
to 1 if it was to its default -1.
|
||||
to 1 if it was -1.
|
||||
|
||||
To make FFmpeg recognize the format automatically, this directive must
|
||||
appears exactly as is (no extra space or byte-order-mark) on the very first
|
||||
@ -192,7 +192,9 @@ component.
|
||||
|
||||
If set to 0, any file name is accepted.
|
||||
|
||||
The default is -1, it is equivalent to 1 if the format was automatically
|
||||
The default is 1.
|
||||
|
||||
-1 is equivalent to 1 if the format was automatically
|
||||
probed and 0 otherwise.
|
||||
|
||||
@item auto_convert
|
||||
|
@ -403,6 +403,35 @@ finding a new maintainer and also don't forget to update the @file{MAINTAINERS}
|
||||
|
||||
We think our rules are not too hard. If you have comments, contact us.
|
||||
|
||||
@section Code of conduct
|
||||
|
||||
Be friendly and respectful towards others and third parties.
|
||||
Treat others the way you yourself want to be treated.
|
||||
|
||||
Be considerate. Not everyone shares the same viewpoint and priorities as you do.
|
||||
Different opinions and interpretations help the project.
|
||||
Looking at issues from a different perspective assists development.
|
||||
|
||||
Do not assume malice for things that can be attributed to incompetence. Even if
|
||||
it is malice, it's rarely good to start with that as initial assumption.
|
||||
|
||||
Stay friendly even if someone acts contrarily. Everyone has a bad day
|
||||
once in a while.
|
||||
If you yourself have a bad day or are angry then try to take a break and reply
|
||||
once you are calm and without anger if you have to.
|
||||
|
||||
Try to help other team members and cooperate if you can.
|
||||
|
||||
The goal of software development is to create technical excellence, not for any
|
||||
individual to be better and "win" against the others. Large software projects
|
||||
are only possible and successful through teamwork.
|
||||
|
||||
If someone struggles do not put them down. Give them a helping hand
|
||||
instead and point them in the right direction.
|
||||
|
||||
Finally, keep in mind the immortal words of Bill and Ted,
|
||||
"Be excellent to each other."
|
||||
|
||||
@anchor{Submitting patches}
|
||||
@section Submitting patches
|
||||
|
||||
|
@ -950,7 +950,7 @@ following image formats are supported:
|
||||
@item COOK @tab @tab X
|
||||
@tab All versions except 5.1 are supported.
|
||||
@item DCA (DTS Coherent Acoustics) @tab X @tab X
|
||||
@tab supported extensions: XCh, XLL (partially)
|
||||
@tab supported extensions: XCh, XXCH, X96, XBR, XLL
|
||||
@item DPCM id RoQ @tab X @tab X
|
||||
@tab Used in Quake III, Jedi Knight 2 and other computer games.
|
||||
@item DPCM Interplay @tab @tab X
|
||||
|
@ -869,7 +869,7 @@ Return 1 if @var{x} is lesser than or equal to @var{y}, 0 otherwise.
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
|
||||
@item min(x, y)
|
||||
Return the maximum between @var{x} and @var{y}.
|
||||
Return the minimum between @var{x} and @var{y}.
|
||||
|
||||
@item mod(x, y)
|
||||
Compute the remainder of division of @var{x} by @var{y}.
|
||||
|
3
ffmpeg.c
3
ffmpeg.c
@ -2893,7 +2893,8 @@ static int transcode_init(void)
|
||||
* overhead
|
||||
*/
|
||||
if(!strcmp(oc->oformat->name, "avi")) {
|
||||
if ( copy_tb<0 && av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
if ( copy_tb<0 && ist->st->r_frame_rate.num
|
||||
&& av_q2d(ist->st->r_frame_rate) >= av_q2d(ist->st->avg_frame_rate)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(ist->st->time_base)
|
||||
&& 0.5/av_q2d(ist->st->r_frame_rate) > av_q2d(dec_ctx->time_base)
|
||||
&& av_q2d(ist->st->time_base) < 1.0/500 && av_q2d(dec_ctx->time_base) < 1.0/500
|
||||
|
2
ffplay.c
2
ffplay.c
@ -2730,7 +2730,7 @@ static int stream_component_open(VideoState *is, int stream_index)
|
||||
goto fail;
|
||||
link = is->out_audio_filter->inputs[0];
|
||||
sample_rate = link->sample_rate;
|
||||
nb_channels = link->channels;
|
||||
nb_channels = avfilter_link_get_channels(link);
|
||||
channel_layout = link->channel_layout;
|
||||
}
|
||||
#else
|
||||
|
@ -373,8 +373,8 @@ static void ffm_set_write_index(AVFormatContext *s, int64_t pos,
|
||||
int64_t file_size)
|
||||
{
|
||||
av_opt_set_int(s, "server_attached", 1, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "write_index", pos, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "file_size", file_size, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "ffm_write_index", pos, AV_OPT_SEARCH_CHILDREN);
|
||||
av_opt_set_int(s, "ffm_file_size", file_size, AV_OPT_SEARCH_CHILDREN);
|
||||
}
|
||||
|
||||
static char *ctime1(char *buf2, size_t buf_size)
|
||||
@ -3858,6 +3858,8 @@ drop:
|
||||
if (avformat_write_header(s, NULL) < 0) {
|
||||
http_log("Container doesn't support the required parameters\n");
|
||||
avio_closep(&s->pb);
|
||||
s->streams = NULL;
|
||||
s->nb_streams = 0;
|
||||
avformat_free_context(s);
|
||||
goto bail;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#ifndef AVCODEC_AACENC_UTILS_H
|
||||
#define AVCODEC_AACENC_UTILS_H
|
||||
|
||||
#include "libavutil/internal.h"
|
||||
#include "aac.h"
|
||||
#include "aacenctab.h"
|
||||
#include "aactab.h"
|
||||
@ -66,13 +67,13 @@ static inline void quantize_bands(int *out, const float *in, const float *scaled
|
||||
const float rounding)
|
||||
{
|
||||
int i;
|
||||
double qc;
|
||||
for (i = 0; i < size; i++) {
|
||||
qc = scaled[i] * Q34;
|
||||
out[i] = (int)FFMIN(qc + rounding, (double)maxval);
|
||||
float qc = scaled[i] * Q34;
|
||||
int tmp = (int)FFMIN(qc + rounding, (float)maxval);
|
||||
if (is_signed && in[i] < 0.0f) {
|
||||
out[i] = -out[i];
|
||||
tmp = -tmp;
|
||||
}
|
||||
out[i] = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,8 +91,7 @@ static inline float find_max_val(int group_len, int swb_size, const float *scale
|
||||
|
||||
static inline int find_min_book(float maxval, int sf)
|
||||
{
|
||||
float Q = ff_aac_pow2sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
float Q34 = sqrtf(Q * sqrtf(Q));
|
||||
float Q34 = ff_aac_pow34sf_tab[POW_SF2_ZERO - sf + SCALE_ONE_POS - SCALE_DIV_512];
|
||||
int qmaxval, cb;
|
||||
qmaxval = maxval * Q34 + C_QUANT;
|
||||
if (qmaxval >= (FF_ARRAY_ELEMS(aac_maxval_cb)))
|
||||
@ -123,7 +123,10 @@ static inline float find_form_factor(int group_len, int swb_size, float thresh,
|
||||
if (s >= ethresh) {
|
||||
nzl += 1.0f;
|
||||
} else {
|
||||
nzl += powf(s / ethresh, nzslope);
|
||||
if (nzslope == 2.f)
|
||||
nzl += (s / ethresh) * (s / ethresh);
|
||||
else
|
||||
nzl += ff_fast_powf(s / ethresh, nzslope);
|
||||
}
|
||||
}
|
||||
if (e2 > thresh) {
|
||||
|
@ -895,11 +895,13 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
|
||||
ff_eac3_default_spx_band_struct,
|
||||
&s->num_spx_bands,
|
||||
s->spx_band_sizes);
|
||||
} else {
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!s->eac3 || !s->spx_in_use) {
|
||||
s->spx_in_use = 0;
|
||||
for (ch = 1; ch <= fbw_channels; ch++) {
|
||||
s->channel_uses_spx[ch] = 0;
|
||||
s->first_spx_coords[ch] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1372,7 +1372,7 @@ static void ape_unpack_stereo(APEContext *ctx, int count)
|
||||
int32_t *decoded0 = ctx->decoded[0];
|
||||
int32_t *decoded1 = ctx->decoded[1];
|
||||
|
||||
if (ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) {
|
||||
if ((ctx->frameflags & APE_FRAMECODE_STEREO_SILENCE) == APE_FRAMECODE_STEREO_SILENCE) {
|
||||
/* We are pure silence, so we're done. */
|
||||
av_log(ctx->avctx, AV_LOG_DEBUG, "pure silence stereo\n");
|
||||
return;
|
||||
|
@ -401,10 +401,12 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
if (size>INT_MAX - 5 || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
if (p - pkt->data < size + 5)
|
||||
return 0;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
@ -415,7 +417,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data >= size);
|
||||
av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size);
|
||||
pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
@ -63,10 +63,12 @@ restart:
|
||||
continue;
|
||||
}
|
||||
bpc->pc.frame_start_found++;
|
||||
bpc->remaining_size = bpc->fsize + i - 17;
|
||||
bpc->remaining_size = bpc->fsize + FFMAX(i - 17, 0);
|
||||
|
||||
if (bpc->pc.index + i > 17) {
|
||||
next = i - 17;
|
||||
state = 0;
|
||||
break;
|
||||
} else
|
||||
goto restart;
|
||||
} else if (bpc->pc.frame_start_found)
|
||||
|
@ -756,6 +756,6 @@ AVCodec ff_cfhd_decoder = {
|
||||
.init = cfhd_decode_init,
|
||||
.close = cfhd_close_decoder,
|
||||
.decode = cfhd_decode,
|
||||
.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS,
|
||||
.capabilities = AV_CODEC_CAP_DR1,
|
||||
.caps_internal = FF_CODEC_CAP_INIT_THREADSAFE | FF_CODEC_CAP_INIT_CLEANUP,
|
||||
};
|
||||
|
@ -1760,6 +1760,7 @@ static int parse_x96_frame_exss(DCACoreDecoder *s)
|
||||
return ret;
|
||||
|
||||
// Channel set data
|
||||
s->x96_nchannels = 0;
|
||||
for (i = 0, x96_base_ch = 0; i < x96_nchsets; i++) {
|
||||
header_pos = get_bits_count(&s->gb);
|
||||
|
||||
@ -1899,9 +1900,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1921,9 +1923,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->x96_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "X96 sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -1946,9 +1949,10 @@ static int parse_optional_info(DCACoreDecoder *s)
|
||||
}
|
||||
}
|
||||
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE) {
|
||||
if (!s->xxch_pos) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "XXCH sync word not found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (s->avctx->err_recognition & AV_EF_EXPLODE)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ typedef struct DiracContext {
|
||||
|
||||
struct {
|
||||
unsigned prefix_bytes;
|
||||
unsigned size_scaler;
|
||||
uint64_t size_scaler;
|
||||
} highquality;
|
||||
|
||||
struct {
|
||||
@ -826,9 +826,15 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
|
||||
|
||||
/* Luma + 2 Chroma planes */
|
||||
for (i = 0; i < 3; i++) {
|
||||
int length = s->highquality.size_scaler * get_bits(gb, 8);
|
||||
int bits_left = 8 * length;
|
||||
int bits_end = get_bits_count(gb) + bits_left;
|
||||
int64_t length = s->highquality.size_scaler * get_bits(gb, 8);
|
||||
int64_t bits_left = 8 * length;
|
||||
int64_t bits_end = get_bits_count(gb) + bits_left;
|
||||
|
||||
if (bits_end >= INT_MAX) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "end too far away\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
for (level = 0; level < s->wavelet_depth; level++) {
|
||||
for (orientation = !!level; orientation < 4; orientation++) {
|
||||
decode_subband(s, gb, quants[level][orientation], slice->slice_x, slice->slice_y, bits_end,
|
||||
@ -848,7 +854,8 @@ static int decode_hq_slice(AVCodecContext *avctx, void *arg)
|
||||
static int decode_lowdelay(DiracContext *s)
|
||||
{
|
||||
AVCodecContext *avctx = s->avctx;
|
||||
int slice_x, slice_y, bytes = 0, bufsize;
|
||||
int slice_x, slice_y, bufsize;
|
||||
int64_t bytes = 0;
|
||||
const uint8_t *buf;
|
||||
DiracSlice *slices;
|
||||
int slice_num = 0;
|
||||
@ -872,6 +879,11 @@ static int decode_lowdelay(DiracContext *s)
|
||||
if (bytes <= bufsize/8)
|
||||
bytes += buf[bytes] * s->highquality.size_scaler + 1;
|
||||
}
|
||||
if (bytes >= INT_MAX) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "too many bytes\n");
|
||||
av_free(slices);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
@ -891,8 +903,8 @@ static int decode_lowdelay(DiracContext *s)
|
||||
} else {
|
||||
for (slice_y = 0; bufsize > 0 && slice_y < s->num_y; slice_y++) {
|
||||
for (slice_x = 0; bufsize > 0 && slice_x < s->num_x; slice_x++) {
|
||||
bytes = (slice_num+1) * s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
bytes = (slice_num+1) * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den
|
||||
- slice_num * (int64_t)s->lowdelay.bytes.num / s->lowdelay.bytes.den;
|
||||
slices[slice_num].bytes = bytes;
|
||||
slices[slice_num].slice_x = slice_x;
|
||||
slices[slice_num].slice_y = slice_y;
|
||||
@ -1151,6 +1163,10 @@ static int dirac_unpack_idwt_params(DiracContext *s)
|
||||
} else if (s->hq_picture) {
|
||||
s->highquality.prefix_bytes = svq3_get_ue_golomb(gb);
|
||||
s->highquality.size_scaler = svq3_get_ue_golomb(gb);
|
||||
if (s->highquality.prefix_bytes >= INT_MAX / 8) {
|
||||
av_log(s->avctx,AV_LOG_ERROR,"too many prefix bytes\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
/* [DIRAC_STD] 11.3.5 Quantisation matrices (low-delay syntax). quant_matrix() */
|
||||
|
@ -1678,6 +1678,47 @@ again:
|
||||
|
||||
ret = 0;
|
||||
end:
|
||||
|
||||
#if CONFIG_ERROR_RESILIENCE
|
||||
sl = h->slice_ctx;
|
||||
/*
|
||||
* FIXME: Error handling code does not seem to support interlaced
|
||||
* when slices span multiple rows
|
||||
* The ff_er_add_slice calls don't work right for bottom
|
||||
* fields; they cause massive erroneous error concealing
|
||||
* Error marking covers both fields (top and bottom).
|
||||
* This causes a mismatched s->error_count
|
||||
* and a bad error table. Further, the error count goes to
|
||||
* INT_MAX when called for bottom field, because mb_y is
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
|
||||
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
|
||||
|
||||
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
|
||||
|
||||
if (use_last_pic) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
|
||||
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
|
||||
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
|
||||
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
|
||||
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
|
||||
} else if (sl->ref_count[0]) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
|
||||
} else
|
||||
ff_h264_set_erpic(&sl->er.last_pic, NULL);
|
||||
|
||||
if (sl->ref_count[1])
|
||||
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
|
||||
|
||||
sl->er.ref_count = sl->ref_count[0];
|
||||
|
||||
ff_er_frame_end(&sl->er);
|
||||
if (use_last_pic)
|
||||
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
|
||||
}
|
||||
#endif /* CONFIG_ERROR_RESILIENCE */
|
||||
/* clean up */
|
||||
if (h->cur_pic_ptr && !h->droppable) {
|
||||
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
|
||||
@ -1740,7 +1781,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
const uint8_t *p= buf+6;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x67)
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 7)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
@ -1749,7 +1790,7 @@ static int is_extra(const uint8_t *buf, int buf_size)
|
||||
return 0;
|
||||
while(cnt--){
|
||||
int nalsize= AV_RB16(p) + 2;
|
||||
if(nalsize > buf_size - (p-buf) || p[2]!=0x68)
|
||||
if(nalsize > buf_size - (p-buf) || (p[2] & 0x9F) != 8)
|
||||
return 0;
|
||||
p += nalsize;
|
||||
}
|
||||
|
@ -186,47 +186,6 @@ int ff_h264_field_end(H264Context *h, H264SliceContext *sl, int in_setup)
|
||||
ff_vdpau_h264_picture_complete(h);
|
||||
#endif
|
||||
|
||||
#if CONFIG_ERROR_RESILIENCE
|
||||
av_assert0(sl == h->slice_ctx);
|
||||
/*
|
||||
* FIXME: Error handling code does not seem to support interlaced
|
||||
* when slices span multiple rows
|
||||
* The ff_er_add_slice calls don't work right for bottom
|
||||
* fields; they cause massive erroneous error concealing
|
||||
* Error marking covers both fields (top and bottom).
|
||||
* This causes a mismatched s->error_count
|
||||
* and a bad error table. Further, the error count goes to
|
||||
* INT_MAX when called for bottom field, because mb_y is
|
||||
* past end by one (callers fault) and resync_mb_y != 0
|
||||
* causes problems for the first MB line, too.
|
||||
*/
|
||||
if (!FIELD_PICTURE(h) && h->current_slice && !h->sps.new && h->enable_er) {
|
||||
int use_last_pic = h->last_pic_for_ec.f->buf[0] && !sl->ref_count[0];
|
||||
|
||||
ff_h264_set_erpic(&sl->er.cur_pic, h->cur_pic_ptr);
|
||||
|
||||
if (use_last_pic) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, &h->last_pic_for_ec);
|
||||
sl->ref_list[0][0].parent = &h->last_pic_for_ec;
|
||||
memcpy(sl->ref_list[0][0].data, h->last_pic_for_ec.f->data, sizeof(sl->ref_list[0][0].data));
|
||||
memcpy(sl->ref_list[0][0].linesize, h->last_pic_for_ec.f->linesize, sizeof(sl->ref_list[0][0].linesize));
|
||||
sl->ref_list[0][0].reference = h->last_pic_for_ec.reference;
|
||||
} else if (sl->ref_count[0]) {
|
||||
ff_h264_set_erpic(&sl->er.last_pic, sl->ref_list[0][0].parent);
|
||||
} else
|
||||
ff_h264_set_erpic(&sl->er.last_pic, NULL);
|
||||
|
||||
if (sl->ref_count[1])
|
||||
ff_h264_set_erpic(&sl->er.next_pic, sl->ref_list[1][0].parent);
|
||||
|
||||
sl->er.ref_count = sl->ref_count[0];
|
||||
|
||||
ff_er_frame_end(&sl->er);
|
||||
if (use_last_pic)
|
||||
memset(&sl->ref_list[0][0], 0, sizeof(sl->ref_list[0][0]));
|
||||
}
|
||||
#endif /* CONFIG_ERROR_RESILIENCE */
|
||||
|
||||
if (!in_setup && !h->droppable)
|
||||
ff_thread_report_progress(&h->cur_pic_ptr->tf, INT_MAX,
|
||||
h->picture_structure == PICT_BOTTOM_FIELD);
|
||||
|
@ -1282,9 +1282,13 @@ int ff_h264_decode_slice_header(H264Context *h, H264SliceContext *sl)
|
||||
|
||||
if (first_slice) {
|
||||
h->pps = *h->pps_buffers[pps_id];
|
||||
} else if (h->setup_finished && h->dequant_coeff_pps != pps_id) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
} else {
|
||||
if (h->pps.sps_id != pps->sps_id ||
|
||||
h->pps.transform_8x8_mode != pps->transform_8x8_mode ||
|
||||
(h->setup_finished && h->dequant_coeff_pps != pps_id)) {
|
||||
av_log(h->avctx, AV_LOG_ERROR, "PPS changed between slices\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
if (pps->sps_id != h->sps.sps_id ||
|
||||
|
@ -3149,6 +3149,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
|
||||
s->context_initialized = 1;
|
||||
s->eos = 0;
|
||||
|
||||
ff_hevc_reset_sei(s);
|
||||
|
||||
return 0;
|
||||
|
||||
fail:
|
||||
|
@ -1092,6 +1092,15 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
int ff_hevc_encode_nal_vps(HEVCVPS *vps, unsigned int id,
|
||||
uint8_t *buf, int buf_size);
|
||||
|
||||
/**
|
||||
* Reset SEI values that are stored on the Context.
|
||||
* e.g. Caption data that was extracted during NAL
|
||||
* parsing.
|
||||
*
|
||||
* @param s HEVCContext.
|
||||
*/
|
||||
void ff_hevc_reset_sei(HEVCContext *s);
|
||||
|
||||
extern const uint8_t ff_hevc_qpel_extra_before[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra_after[4];
|
||||
extern const uint8_t ff_hevc_qpel_extra[4];
|
||||
|
@ -232,8 +232,14 @@ int ff_hevc_split_packet(HEVCContext *s, HEVCPacket *pkt, const uint8_t *buf, in
|
||||
++buf;
|
||||
--length;
|
||||
if (length < 4) {
|
||||
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (pkt->nb_nals > 0) {
|
||||
// No more start codes: we discarded some irrelevant
|
||||
// bytes at the end of the packet.
|
||||
return 0;
|
||||
} else {
|
||||
av_log(avctx, AV_LOG_ERROR, "No start code is found.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -209,6 +209,8 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf,
|
||||
|
||||
h->avctx = avctx;
|
||||
|
||||
ff_hevc_reset_sei(h);
|
||||
|
||||
if (!buf_size)
|
||||
return 0;
|
||||
|
||||
|
@ -373,3 +373,9 @@ int ff_hevc_decode_nal_sei(HEVCContext *s)
|
||||
} while (more_rbsp_data(&s->HEVClc->gb));
|
||||
return 1;
|
||||
}
|
||||
|
||||
void ff_hevc_reset_sei(HEVCContext *s)
|
||||
{
|
||||
s->a53_caption_size = 0;
|
||||
av_freep(&s->a53_caption);
|
||||
}
|
||||
|
@ -146,6 +146,7 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
AVFrame *picture = data;
|
||||
AVFrame * const p = s->picture;
|
||||
int start, ret;
|
||||
int ltab, ctab;
|
||||
|
||||
if ((ret = ff_reget_buffer(avctx, p)) < 0)
|
||||
return ret;
|
||||
@ -168,34 +169,36 @@ static int ir2_decode_frame(AVCodecContext *avctx,
|
||||
if ((ret = init_get_bits8(&s->gb, buf + start, buf_size - start)) < 0)
|
||||
return ret;
|
||||
|
||||
ltab = buf[0x22] & 3;
|
||||
ctab = buf[0x22] >> 2;
|
||||
if (s->decode_delta) { /* intraframe */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
} else { /* interframe */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width, avctx->height,
|
||||
p->data[0], p->linesize[0],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ltab])) < 0)
|
||||
return ret;
|
||||
/* swapped U and V */
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[2], p->linesize[2],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
if ((ret = ir2_decode_plane_inter(s, avctx->width >> 2, avctx->height >> 2,
|
||||
p->data[1], p->linesize[1],
|
||||
ir2_luma_table)) < 0)
|
||||
ir2_delta_table[ctab])) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -27,115 +27,211 @@
|
||||
#define IR2_CODES 143
|
||||
static const uint16_t ir2_codes[IR2_CODES][2] = {
|
||||
#ifdef BITSTREAM_READER_LE
|
||||
{0x0000, 3}, {0x0004, 3}, {0x0006, 3}, {0x0001, 5},
|
||||
{0x0009, 5}, {0x0019, 5}, {0x000D, 5}, {0x001D, 5},
|
||||
{0x0023, 6}, {0x0013, 6}, {0x0033, 6}, {0x000B, 6},
|
||||
{0x002B, 6}, {0x001B, 6}, {0x0007, 8}, {0x0087, 8},
|
||||
{0x0027, 8}, {0x00A7, 8}, {0x0067, 8}, {0x00E7, 8},
|
||||
{0x0097, 8}, {0x0057, 8}, {0x0037, 8}, {0x00B7, 8},
|
||||
{0x00F7, 8}, {0x000F, 9}, {0x008F, 9}, {0x018F, 9},
|
||||
{0x014F, 9}, {0x00CF, 9}, {0x002F, 9}, {0x012F, 9},
|
||||
{0x01AF, 9}, {0x006F, 9}, {0x00EF, 9}, {0x01EF, 9},
|
||||
{0x001F, 10}, {0x021F, 10}, {0x011F, 10}, {0x031F, 10},
|
||||
{0x009F, 10}, {0x029F, 10}, {0x019F, 10}, {0x039F, 10},
|
||||
{0x005F, 10}, {0x025F, 10}, {0x015F, 10}, {0x035F, 10},
|
||||
{0x00DF, 10}, {0x02DF, 10}, {0x01DF, 10}, {0x03DF, 10},
|
||||
{0x003F, 13}, {0x103F, 13}, {0x083F, 13}, {0x183F, 13},
|
||||
{0x043F, 13}, {0x143F, 13}, {0x0C3F, 13}, {0x1C3F, 13},
|
||||
{0x023F, 13}, {0x123F, 13}, {0x0A3F, 13}, {0x1A3F, 13},
|
||||
{0x063F, 13}, {0x163F, 13}, {0x0E3F, 13}, {0x1E3F, 13},
|
||||
{0x013F, 13}, {0x113F, 13}, {0x093F, 13}, {0x193F, 13},
|
||||
{0x053F, 13}, {0x153F, 13}, {0x0D3F, 13}, {0x1D3F, 13},
|
||||
{0x033F, 13}, {0x133F, 13}, {0x0B3F, 13}, {0x1B3F, 13},
|
||||
{0x073F, 13}, {0x173F, 13}, {0x0F3F, 13}, {0x1F3F, 13},
|
||||
{0x00BF, 13}, {0x10BF, 13}, {0x08BF, 13}, {0x18BF, 13},
|
||||
{0x04BF, 13}, {0x14BF, 13}, {0x0CBF, 13}, {0x1CBF, 13},
|
||||
{0x02BF, 13}, {0x12BF, 13}, {0x0ABF, 13}, {0x1ABF, 13},
|
||||
{0x06BF, 13}, {0x16BF, 13}, {0x0EBF, 13}, {0x1EBF, 13},
|
||||
{0x01BF, 13}, {0x11BF, 13}, {0x09BF, 13}, {0x19BF, 13},
|
||||
{0x05BF, 13}, {0x15BF, 13}, {0x0DBF, 13}, {0x1DBF, 13},
|
||||
{0x03BF, 13}, {0x13BF, 13}, {0x0BBF, 13}, {0x1BBF, 13},
|
||||
{0x07BF, 13}, {0x17BF, 13}, {0x0FBF, 13}, {0x1FBF, 13},
|
||||
{0x007F, 14}, {0x207F, 14}, {0x107F, 14}, {0x307F, 14},
|
||||
{0x087F, 14}, {0x287F, 14}, {0x187F, 14}, {0x387F, 14},
|
||||
{0x047F, 14}, {0x247F, 14}, {0x147F, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0005, 5}, {0x0015, 5}, {0x0003, 6},
|
||||
{0x003B, 6}, {0x0047, 8}, {0x00C7, 8}, {0x0017, 8},
|
||||
{0x00D7, 8}, {0x0077, 8}, {0x010F, 9}, {0x004F, 9},
|
||||
{0x01CF, 9}, {0x00AF, 9}, {0x016F, 9},
|
||||
{ 0x0000, 3 }, { 0x0004, 3 }, { 0x0006, 3 }, { 0x0001, 5 },
|
||||
{ 0x0009, 5 }, { 0x0019, 5 }, { 0x000D, 5 }, { 0x001D, 5 },
|
||||
{ 0x0023, 6 }, { 0x0013, 6 }, { 0x0033, 6 }, { 0x000B, 6 },
|
||||
{ 0x002B, 6 }, { 0x001B, 6 }, { 0x0007, 8 }, { 0x0087, 8 },
|
||||
{ 0x0027, 8 }, { 0x00A7, 8 }, { 0x0067, 8 }, { 0x00E7, 8 },
|
||||
{ 0x0097, 8 }, { 0x0057, 8 }, { 0x0037, 8 }, { 0x00B7, 8 },
|
||||
{ 0x00F7, 8 }, { 0x000F, 9 }, { 0x008F, 9 }, { 0x018F, 9 },
|
||||
{ 0x014F, 9 }, { 0x00CF, 9 }, { 0x002F, 9 }, { 0x012F, 9 },
|
||||
{ 0x01AF, 9 }, { 0x006F, 9 }, { 0x00EF, 9 }, { 0x01EF, 9 },
|
||||
{ 0x001F, 10 }, { 0x021F, 10 }, { 0x011F, 10 }, { 0x031F, 10 },
|
||||
{ 0x009F, 10 }, { 0x029F, 10 }, { 0x019F, 10 }, { 0x039F, 10 },
|
||||
{ 0x005F, 10 }, { 0x025F, 10 }, { 0x015F, 10 }, { 0x035F, 10 },
|
||||
{ 0x00DF, 10 }, { 0x02DF, 10 }, { 0x01DF, 10 }, { 0x03DF, 10 },
|
||||
{ 0x003F, 13 }, { 0x103F, 13 }, { 0x083F, 13 }, { 0x183F, 13 },
|
||||
{ 0x043F, 13 }, { 0x143F, 13 }, { 0x0C3F, 13 }, { 0x1C3F, 13 },
|
||||
{ 0x023F, 13 }, { 0x123F, 13 }, { 0x0A3F, 13 }, { 0x1A3F, 13 },
|
||||
{ 0x063F, 13 }, { 0x163F, 13 }, { 0x0E3F, 13 }, { 0x1E3F, 13 },
|
||||
{ 0x013F, 13 }, { 0x113F, 13 }, { 0x093F, 13 }, { 0x193F, 13 },
|
||||
{ 0x053F, 13 }, { 0x153F, 13 }, { 0x0D3F, 13 }, { 0x1D3F, 13 },
|
||||
{ 0x033F, 13 }, { 0x133F, 13 }, { 0x0B3F, 13 }, { 0x1B3F, 13 },
|
||||
{ 0x073F, 13 }, { 0x173F, 13 }, { 0x0F3F, 13 }, { 0x1F3F, 13 },
|
||||
{ 0x00BF, 13 }, { 0x10BF, 13 }, { 0x08BF, 13 }, { 0x18BF, 13 },
|
||||
{ 0x04BF, 13 }, { 0x14BF, 13 }, { 0x0CBF, 13 }, { 0x1CBF, 13 },
|
||||
{ 0x02BF, 13 }, { 0x12BF, 13 }, { 0x0ABF, 13 }, { 0x1ABF, 13 },
|
||||
{ 0x06BF, 13 }, { 0x16BF, 13 }, { 0x0EBF, 13 }, { 0x1EBF, 13 },
|
||||
{ 0x01BF, 13 }, { 0x11BF, 13 }, { 0x09BF, 13 }, { 0x19BF, 13 },
|
||||
{ 0x05BF, 13 }, { 0x15BF, 13 }, { 0x0DBF, 13 }, { 0x1DBF, 13 },
|
||||
{ 0x03BF, 13 }, { 0x13BF, 13 }, { 0x0BBF, 13 }, { 0x1BBF, 13 },
|
||||
{ 0x07BF, 13 }, { 0x17BF, 13 }, { 0x0FBF, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x007F, 14 }, { 0x207F, 14 }, { 0x107F, 14 }, { 0x307F, 14 },
|
||||
{ 0x087F, 14 }, { 0x287F, 14 }, { 0x187F, 14 }, { 0x387F, 14 },
|
||||
{ 0x047F, 14 }, { 0x247F, 14 }, { 0x147F, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0005, 5 }, { 0x0015, 5 }, { 0x0003, 6 },
|
||||
{ 0x003B, 6 }, { 0x0047, 8 }, { 0x00C7, 8 }, { 0x0017, 8 },
|
||||
{ 0x00D7, 8 }, { 0x0077, 8 }, { 0x010F, 9 }, { 0x004F, 9 },
|
||||
{ 0x01CF, 9 }, { 0x00AF, 9 }, { 0x016F, 9 },
|
||||
#else
|
||||
{0x0000, 3}, {0x0001, 3}, {0x0003, 3}, {0x0010, 5},
|
||||
{0x0012, 5}, {0x0013, 5}, {0x0016, 5}, {0x0017, 5},
|
||||
{0x0031, 6}, {0x0032, 6}, {0x0033, 6}, {0x0034, 6},
|
||||
{0x0035, 6}, {0x0036, 6}, {0x00E0, 8}, {0x00E1, 8},
|
||||
{0x00E4, 8}, {0x00E5, 8}, {0x00E6, 8}, {0x00E7, 8},
|
||||
{0x00E9, 8}, {0x00EA, 8}, {0x00EC, 8}, {0x00ED, 8},
|
||||
{0x00EF, 8}, {0x01E0, 9}, {0x01E2, 9}, {0x01E3, 9},
|
||||
{0x01E5, 9}, {0x01E6, 9}, {0x01E8, 9}, {0x01E9, 9},
|
||||
{0x01EB, 9}, {0x01EC, 9}, {0x01EE, 9}, {0x01EF, 9},
|
||||
{0x03E0, 10}, {0x03E1, 10}, {0x03E2, 10}, {0x03E3, 10},
|
||||
{0x03E4, 10}, {0x03E5, 10}, {0x03E6, 10}, {0x03E7, 10},
|
||||
{0x03E8, 10}, {0x03E9, 10}, {0x03EA, 10}, {0x03EB, 10},
|
||||
{0x03EC, 10}, {0x03ED, 10}, {0x03EE, 10}, {0x03EF, 10},
|
||||
{0x1F80, 13}, {0x1F81, 13}, {0x1F82, 13}, {0x1F83, 13},
|
||||
{0x1F84, 13}, {0x1F85, 13}, {0x1F86, 13}, {0x1F87, 13},
|
||||
{0x1F88, 13}, {0x1F89, 13}, {0x1F8A, 13}, {0x1F8B, 13},
|
||||
{0x1F8C, 13}, {0x1F8D, 13}, {0x1F8E, 13}, {0x1F8F, 13},
|
||||
{0x1F90, 13}, {0x1F91, 13}, {0x1F92, 13}, {0x1F93, 13},
|
||||
{0x1F94, 13}, {0x1F95, 13}, {0x1F96, 13}, {0x1F97, 13},
|
||||
{0x1F98, 13}, {0x1F99, 13}, {0x1F9A, 13}, {0x1F9B, 13},
|
||||
{0x1F9C, 13}, {0x1F9D, 13}, {0x1F9E, 13}, {0x1F9F, 13},
|
||||
{0x1FA0, 13}, {0x1FA1, 13}, {0x1FA2, 13}, {0x1FA3, 13},
|
||||
{0x1FA4, 13}, {0x1FA5, 13}, {0x1FA6, 13}, {0x1FA7, 13},
|
||||
{0x1FA8, 13}, {0x1FA9, 13}, {0x1FAA, 13}, {0x1FAB, 13},
|
||||
{0x1FAC, 13}, {0x1FAD, 13}, {0x1FAE, 13}, {0x1FAF, 13},
|
||||
{0x1FB0, 13}, {0x1FB1, 13}, {0x1FB2, 13}, {0x1FB3, 13},
|
||||
{0x1FB4, 13}, {0x1FB5, 13}, {0x1FB6, 13}, {0x1FB7, 13},
|
||||
{0x1FB8, 13}, {0x1FB9, 13}, {0x1FBA, 13}, {0x1FBB, 13},
|
||||
{0x1FBC, 13}, {0x1FBD, 13}, {0x1FBE, 13}, {0x1FBF, 13},
|
||||
{0x3F80, 14}, {0x3F81, 14}, {0x3F82, 14}, {0x3F83, 14},
|
||||
{0x3F84, 14}, {0x3F85, 14}, {0x3F86, 14}, {0x3F87, 14},
|
||||
{0x3F88, 14}, {0x3F89, 14}, {0x3F8A, 14}, {0x0002, 3},
|
||||
{0x0011, 5}, {0x0014, 5}, {0x0015, 5}, {0x0030, 6},
|
||||
{0x0037, 6}, {0x00E2, 8}, {0x00E3, 8}, {0x00E8, 8},
|
||||
{0x00EB, 8}, {0x00EE, 8}, {0x01E1, 9}, {0x01E4, 9},
|
||||
{0x01E7, 9}, {0x01EA, 9}, {0x01ED, 9}
|
||||
{ 0x0000, 3 }, { 0x0001, 3 }, { 0x0003, 3 }, { 0x0010, 5 },
|
||||
{ 0x0012, 5 }, { 0x0013, 5 }, { 0x0016, 5 }, { 0x0017, 5 },
|
||||
{ 0x0031, 6 }, { 0x0032, 6 }, { 0x0033, 6 }, { 0x0034, 6 },
|
||||
{ 0x0035, 6 }, { 0x0036, 6 }, { 0x00E0, 8 }, { 0x00E1, 8 },
|
||||
{ 0x00E4, 8 }, { 0x00E5, 8 }, { 0x00E6, 8 }, { 0x00E7, 8 },
|
||||
{ 0x00E9, 8 }, { 0x00EA, 8 }, { 0x00EC, 8 }, { 0x00ED, 8 },
|
||||
{ 0x00EF, 8 }, { 0x01E0, 9 }, { 0x01E2, 9 }, { 0x01E3, 9 },
|
||||
{ 0x01E5, 9 }, { 0x01E6, 9 }, { 0x01E8, 9 }, { 0x01E9, 9 },
|
||||
{ 0x01EB, 9 }, { 0x01EC, 9 }, { 0x01EE, 9 }, { 0x01EF, 9 },
|
||||
{ 0x03E0, 10 }, { 0x03E1, 10 }, { 0x03E2, 10 }, { 0x03E3, 10 },
|
||||
{ 0x03E4, 10 }, { 0x03E5, 10 }, { 0x03E6, 10 }, { 0x03E7, 10 },
|
||||
{ 0x03E8, 10 }, { 0x03E9, 10 }, { 0x03EA, 10 }, { 0x03EB, 10 },
|
||||
{ 0x03EC, 10 }, { 0x03ED, 10 }, { 0x03EE, 10 }, { 0x03EF, 10 },
|
||||
{ 0x1F80, 13 }, { 0x1F81, 13 }, { 0x1F82, 13 }, { 0x1F83, 13 },
|
||||
{ 0x1F84, 13 }, { 0x1F85, 13 }, { 0x1F86, 13 }, { 0x1F87, 13 },
|
||||
{ 0x1F88, 13 }, { 0x1F89, 13 }, { 0x1F8A, 13 }, { 0x1F8B, 13 },
|
||||
{ 0x1F8C, 13 }, { 0x1F8D, 13 }, { 0x1F8E, 13 }, { 0x1F8F, 13 },
|
||||
{ 0x1F90, 13 }, { 0x1F91, 13 }, { 0x1F92, 13 }, { 0x1F93, 13 },
|
||||
{ 0x1F94, 13 }, { 0x1F95, 13 }, { 0x1F96, 13 }, { 0x1F97, 13 },
|
||||
{ 0x1F98, 13 }, { 0x1F99, 13 }, { 0x1F9A, 13 }, { 0x1F9B, 13 },
|
||||
{ 0x1F9C, 13 }, { 0x1F9D, 13 }, { 0x1F9E, 13 }, { 0x1F9F, 13 },
|
||||
{ 0x1FA0, 13 }, { 0x1FA1, 13 }, { 0x1FA2, 13 }, { 0x1FA3, 13 },
|
||||
{ 0x1FA4, 13 }, { 0x1FA5, 13 }, { 0x1FA6, 13 }, { 0x1FA7, 13 },
|
||||
{ 0x1FA8, 13 }, { 0x1FA9, 13 }, { 0x1FAA, 13 }, { 0x1FAB, 13 },
|
||||
{ 0x1FAC, 13 }, { 0x1FAD, 13 }, { 0x1FAE, 13 }, { 0x1FAF, 13 },
|
||||
{ 0x1FB0, 13 }, { 0x1FB1, 13 }, { 0x1FB2, 13 }, { 0x1FB3, 13 },
|
||||
{ 0x1FB4, 13 }, { 0x1FB5, 13 }, { 0x1FB6, 13 }, { 0x1FB7, 13 },
|
||||
{ 0x1FB8, 13 }, { 0x1FB9, 13 }, { 0x1FBA, 13 }, { 0x1FBB, 13 },
|
||||
{ 0x1FBC, 13 }, { 0x1FBD, 13 }, { 0x1FBE, 13 }, { 0x1FBF, 13 },
|
||||
{ 0x3F80, 14 }, { 0x3F81, 14 }, { 0x3F82, 14 }, { 0x3F83, 14 },
|
||||
{ 0x3F84, 14 }, { 0x3F85, 14 }, { 0x3F86, 14 }, { 0x3F87, 14 },
|
||||
{ 0x3F88, 14 }, { 0x3F89, 14 }, { 0x3F8A, 14 }, { 0x0002, 3 },
|
||||
{ 0x0011, 5 }, { 0x0014, 5 }, { 0x0015, 5 }, { 0x0030, 6 },
|
||||
{ 0x0037, 6 }, { 0x00E2, 8 }, { 0x00E3, 8 }, { 0x00E8, 8 },
|
||||
{ 0x00EB, 8 }, { 0x00EE, 8 }, { 0x01E1, 9 }, { 0x01E4, 9 },
|
||||
{ 0x01E7, 9 }, { 0x01EA, 9 }, { 0x01ED, 9 },
|
||||
#endif
|
||||
};
|
||||
|
||||
static const uint8_t ir2_luma_table[256] = {
|
||||
0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80
|
||||
static const uint8_t ir2_delta_table[4][256] = {
|
||||
{ 0x80, 0x80, 0x84, 0x84, 0x7C, 0x7C, 0x7F, 0x85,
|
||||
0x81, 0x7B, 0x85, 0x7F, 0x7B, 0x81, 0x8C, 0x8C,
|
||||
0x74, 0x74, 0x83, 0x8D, 0x7D, 0x73, 0x8D, 0x83,
|
||||
0x73, 0x7D, 0x77, 0x89, 0x89, 0x77, 0x89, 0x77,
|
||||
0x77, 0x89, 0x8C, 0x95, 0x74, 0x6B, 0x95, 0x8C,
|
||||
0x6B, 0x74, 0x7C, 0x90, 0x84, 0x70, 0x90, 0x7C,
|
||||
0x70, 0x84, 0x96, 0x96, 0x6A, 0x6A, 0x82, 0x98,
|
||||
0x7E, 0x68, 0x98, 0x82, 0x68, 0x7E, 0x97, 0xA2,
|
||||
0x69, 0x5E, 0xA2, 0x97, 0x5E, 0x69, 0xA2, 0xA2,
|
||||
0x5E, 0x5E, 0x8B, 0xA3, 0x75, 0x5D, 0xA3, 0x8B,
|
||||
0x5D, 0x75, 0x71, 0x95, 0x8F, 0x6B, 0x95, 0x71,
|
||||
0x6B, 0x8F, 0x78, 0x9D, 0x88, 0x63, 0x9D, 0x78,
|
||||
0x63, 0x88, 0x7F, 0xA7, 0x81, 0x59, 0xA7, 0x7F,
|
||||
0x59, 0x81, 0xA4, 0xB1, 0x5C, 0x4F, 0xB1, 0xA4,
|
||||
0x4F, 0x5C, 0x96, 0xB1, 0x6A, 0x4F, 0xB1, 0x96,
|
||||
0x4F, 0x6A, 0xB2, 0xB2, 0x4E, 0x4E, 0x65, 0x9B,
|
||||
0x9B, 0x65, 0x9B, 0x65, 0x65, 0x9B, 0x89, 0xB4,
|
||||
0x77, 0x4C, 0xB4, 0x89, 0x4C, 0x77, 0x6A, 0xA3,
|
||||
0x96, 0x5D, 0xA3, 0x6A, 0x5D, 0x96, 0x73, 0xAC,
|
||||
0x8D, 0x54, 0xAC, 0x73, 0x54, 0x8D, 0xB4, 0xC3,
|
||||
0x4C, 0x3D, 0xC3, 0xB4, 0x3D, 0x4C, 0xA4, 0xC3,
|
||||
0x5C, 0x3D, 0xC3, 0xA4, 0x3D, 0x5C, 0xC4, 0xC4,
|
||||
0x3C, 0x3C, 0x96, 0xC6, 0x6A, 0x3A, 0xC6, 0x96,
|
||||
0x3A, 0x6A, 0x7C, 0xBA, 0x84, 0x46, 0xBA, 0x7C,
|
||||
0x46, 0x84, 0x5B, 0xAB, 0xA5, 0x55, 0xAB, 0x5B,
|
||||
0x55, 0xA5, 0x63, 0xB4, 0x9D, 0x4C, 0xB4, 0x63,
|
||||
0x4C, 0x9D, 0x86, 0xCA, 0x7A, 0x36, 0xCA, 0x86,
|
||||
0x36, 0x7A, 0xB6, 0xD7, 0x4A, 0x29, 0xD7, 0xB6,
|
||||
0x29, 0x4A, 0xC8, 0xD7, 0x38, 0x29, 0xD7, 0xC8,
|
||||
0x29, 0x38, 0xA4, 0xD8, 0x5C, 0x28, 0xD8, 0xA4,
|
||||
0x28, 0x5C, 0x6C, 0xC1, 0x94, 0x3F, 0xC1, 0x6C,
|
||||
0x3F, 0x94, 0xD9, 0xD9, 0x27, 0x27, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x85, 0x85, 0x7B, 0x7B, 0x7E, 0x87,
|
||||
0x82, 0x79, 0x87, 0x7E, 0x79, 0x82, 0x8F, 0x8F,
|
||||
0x71, 0x71, 0x84, 0x8F, 0x7C, 0x71, 0x8F, 0x84,
|
||||
0x71, 0x7C, 0x75, 0x8B, 0x8B, 0x75, 0x8B, 0x75,
|
||||
0x75, 0x8B, 0x8E, 0x9A, 0x72, 0x66, 0x9A, 0x8E,
|
||||
0x66, 0x72, 0x7B, 0x93, 0x85, 0x6D, 0x93, 0x7B,
|
||||
0x6D, 0x85, 0x9B, 0x9B, 0x65, 0x65, 0x82, 0x9D,
|
||||
0x7E, 0x63, 0x9D, 0x82, 0x63, 0x7E, 0x9B, 0xA8,
|
||||
0x65, 0x58, 0xA8, 0x9B, 0x58, 0x65, 0xA9, 0xA9,
|
||||
0x57, 0x57, 0x8D, 0xAA, 0x73, 0x56, 0xAA, 0x8D,
|
||||
0x56, 0x73, 0x6E, 0x99, 0x92, 0x67, 0x99, 0x6E,
|
||||
0x67, 0x92, 0x76, 0xA2, 0x8A, 0x5E, 0xA2, 0x76,
|
||||
0x5E, 0x8A, 0x7F, 0xAF, 0x81, 0x51, 0xAF, 0x7F,
|
||||
0x51, 0x81, 0xAB, 0xBA, 0x55, 0x46, 0xBA, 0xAB,
|
||||
0x46, 0x55, 0x9A, 0xBB, 0x66, 0x45, 0xBB, 0x9A,
|
||||
0x45, 0x66, 0xBB, 0xBB, 0x45, 0x45, 0x60, 0xA0,
|
||||
0xA0, 0x60, 0xA0, 0x60, 0x60, 0xA0, 0x8B, 0xBE,
|
||||
0x75, 0x42, 0xBE, 0x8B, 0x42, 0x75, 0x66, 0xAA,
|
||||
0x9A, 0x56, 0xAA, 0x66, 0x56, 0x9A, 0x70, 0xB5,
|
||||
0x90, 0x4B, 0xB5, 0x70, 0x4B, 0x90, 0xBE, 0xCF,
|
||||
0x42, 0x31, 0xCF, 0xBE, 0x31, 0x42, 0xAB, 0xD0,
|
||||
0x55, 0x30, 0xD0, 0xAB, 0x30, 0x55, 0xD1, 0xD1,
|
||||
0x2F, 0x2F, 0x9A, 0xD3, 0x66, 0x2D, 0xD3, 0x9A,
|
||||
0x2D, 0x66, 0x7B, 0xC5, 0x85, 0x3B, 0xC5, 0x7B,
|
||||
0x3B, 0x85, 0x54, 0xB4, 0xAC, 0x4C, 0xB4, 0x54,
|
||||
0x4C, 0xAC, 0x5E, 0xBE, 0xA2, 0x42, 0xBE, 0x5E,
|
||||
0x42, 0xA2, 0x87, 0xD8, 0x79, 0x28, 0xD8, 0x87,
|
||||
0x28, 0x79, 0xC0, 0xE8, 0x40, 0x18, 0xE8, 0xC0,
|
||||
0x18, 0x40, 0xD5, 0xE8, 0x2B, 0x18, 0xE8, 0xD5,
|
||||
0x18, 0x2B, 0xAB, 0xE9, 0x55, 0x17, 0xE9, 0xAB,
|
||||
0x17, 0x55, 0x68, 0xCD, 0x98, 0x33, 0xCD, 0x68,
|
||||
0x33, 0x98, 0xEA, 0xEA, 0x16, 0x16, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x86, 0x86, 0x7A, 0x7A, 0x7E, 0x88,
|
||||
0x82, 0x78, 0x88, 0x7E, 0x78, 0x82, 0x92, 0x92,
|
||||
0x6E, 0x6E, 0x85, 0x92, 0x7B, 0x6E, 0x92, 0x85,
|
||||
0x6E, 0x7B, 0x73, 0x8D, 0x8D, 0x73, 0x8D, 0x73,
|
||||
0x73, 0x8D, 0x91, 0x9E, 0x6F, 0x62, 0x9E, 0x91,
|
||||
0x62, 0x6F, 0x79, 0x97, 0x87, 0x69, 0x97, 0x79,
|
||||
0x69, 0x87, 0xA0, 0xA0, 0x60, 0x60, 0x83, 0xA2,
|
||||
0x7D, 0x5E, 0xA2, 0x83, 0x5E, 0x7D, 0xA0, 0xB0,
|
||||
0x60, 0x50, 0xB0, 0xA0, 0x50, 0x60, 0xB1, 0xB1,
|
||||
0x4F, 0x4F, 0x8F, 0xB2, 0x71, 0x4E, 0xB2, 0x8F,
|
||||
0x4E, 0x71, 0x6B, 0x9E, 0x95, 0x62, 0x9E, 0x6B,
|
||||
0x62, 0x95, 0x74, 0xA9, 0x8C, 0x57, 0xA9, 0x74,
|
||||
0x57, 0x8C, 0x7F, 0xB8, 0x81, 0x48, 0xB8, 0x7F,
|
||||
0x48, 0x81, 0xB4, 0xC5, 0x4C, 0x3B, 0xC5, 0xB4,
|
||||
0x3B, 0x4C, 0x9F, 0xC6, 0x61, 0x3A, 0xC6, 0x9F,
|
||||
0x3A, 0x61, 0xC6, 0xC6, 0x3A, 0x3A, 0x59, 0xA7,
|
||||
0xA7, 0x59, 0xA7, 0x59, 0x59, 0xA7, 0x8D, 0xCA,
|
||||
0x73, 0x36, 0xCA, 0x8D, 0x36, 0x73, 0x61, 0xB2,
|
||||
0x9F, 0x4E, 0xB2, 0x61, 0x4E, 0x9F, 0x6D, 0xBF,
|
||||
0x93, 0x41, 0xBF, 0x6D, 0x41, 0x93, 0xCA, 0xDF,
|
||||
0x36, 0x21, 0xDF, 0xCA, 0x21, 0x36, 0xB3, 0xDF,
|
||||
0x4D, 0x21, 0xDF, 0xB3, 0x21, 0x4D, 0xE1, 0xE1,
|
||||
0x1F, 0x1F, 0x9F, 0xE3, 0x61, 0x1D, 0xE3, 0x9F,
|
||||
0x1D, 0x61, 0x7A, 0xD3, 0x86, 0x2D, 0xD3, 0x7A,
|
||||
0x2D, 0x86, 0x4C, 0xBE, 0xB4, 0x42, 0xBE, 0x4C,
|
||||
0x42, 0xB4, 0x57, 0xCA, 0xA9, 0x36, 0xCA, 0x57,
|
||||
0x36, 0xA9, 0x88, 0xE9, 0x78, 0x17, 0xE9, 0x88,
|
||||
0x17, 0x78, 0xCC, 0xFB, 0x34, 0x05, 0xFB, 0xCC,
|
||||
0x05, 0x34, 0xE6, 0xFB, 0x1A, 0x05, 0xFB, 0xE6,
|
||||
0x05, 0x1A, 0xB4, 0xFD, 0x4C, 0x03, 0xFD, 0xB4,
|
||||
0x03, 0x4C, 0x63, 0xDC, 0x9D, 0x24, 0xDC, 0x63,
|
||||
0x24, 0x9D, 0xFE, 0xFE, 0x02, 0x02, 0x80, 0x80, },
|
||||
{ 0x80, 0x80, 0x87, 0x87, 0x79, 0x79, 0x7E, 0x89,
|
||||
0x82, 0x77, 0x89, 0x7E, 0x77, 0x82, 0x95, 0x95,
|
||||
0x6B, 0x6B, 0x86, 0x96, 0x7A, 0x6A, 0x96, 0x86,
|
||||
0x6A, 0x7A, 0x70, 0x90, 0x90, 0x70, 0x90, 0x70,
|
||||
0x70, 0x90, 0x94, 0xA4, 0x6C, 0x5C, 0xA4, 0x94,
|
||||
0x5C, 0x6C, 0x78, 0x9B, 0x88, 0x65, 0x9B, 0x78,
|
||||
0x65, 0x88, 0xA6, 0xA6, 0x5A, 0x5A, 0x83, 0xA9,
|
||||
0x7D, 0x57, 0xA9, 0x83, 0x57, 0x7D, 0xA6, 0xB9,
|
||||
0x5A, 0x47, 0xB9, 0xA6, 0x47, 0x5A, 0xBA, 0xBA,
|
||||
0x46, 0x46, 0x92, 0xBC, 0x6E, 0x44, 0xBC, 0x92,
|
||||
0x44, 0x6E, 0x67, 0xA3, 0x99, 0x5D, 0xA3, 0x67,
|
||||
0x5D, 0x99, 0x72, 0xB0, 0x8E, 0x50, 0xB0, 0x72,
|
||||
0x50, 0x8E, 0x7F, 0xC3, 0x81, 0x3D, 0xC3, 0x7F,
|
||||
0x3D, 0x81, 0xBE, 0xD2, 0x42, 0x2E, 0xD2, 0xBE,
|
||||
0x2E, 0x42, 0xA5, 0xD4, 0x5B, 0x2C, 0xD4, 0xA5,
|
||||
0x2C, 0x5B, 0xD4, 0xD4, 0x2C, 0x2C, 0x52, 0xAE,
|
||||
0xAE, 0x52, 0xAE, 0x52, 0x52, 0xAE, 0x8F, 0xD8,
|
||||
0x71, 0x28, 0xD8, 0x8F, 0x28, 0x71, 0x5B, 0xBB,
|
||||
0xA5, 0x45, 0xBB, 0x5B, 0x45, 0xA5, 0x69, 0xCB,
|
||||
0x97, 0x35, 0xCB, 0x69, 0x35, 0x97, 0xD8, 0xF0,
|
||||
0x28, 0x10, 0xF0, 0xD8, 0x10, 0x28, 0xBD, 0xF1,
|
||||
0x43, 0x0F, 0xF1, 0xBD, 0x0F, 0x43, 0xF3, 0xF3,
|
||||
0x0D, 0x0D, 0xA5, 0xF6, 0x5B, 0x0A, 0xF6, 0xA5,
|
||||
0x0A, 0x5B, 0x78, 0xE2, 0x88, 0x1E, 0xE2, 0x78,
|
||||
0x1E, 0x88, 0x42, 0xC9, 0xBE, 0x37, 0xC9, 0x42,
|
||||
0x37, 0xBE, 0x4F, 0xD8, 0xB1, 0x28, 0xD8, 0x4F,
|
||||
0x28, 0xB1, 0x8A, 0xFD, 0x76, 0x03, 0xFD, 0x8A,
|
||||
0x03, 0x76, 0xDB, 0xFF, 0x25, 0x01, 0xFF, 0xDB,
|
||||
0x01, 0x25, 0xF9, 0xFF, 0x07, 0x01, 0xFF, 0xF9,
|
||||
0x01, 0x07, 0xBE, 0xFF, 0x42, 0x01, 0xFF, 0xBE,
|
||||
0x01, 0x42, 0x5E, 0xED, 0xA2, 0x13, 0xED, 0x5E,
|
||||
0x13, 0xA2, 0xFF, 0xFF, 0x01, 0x01, 0x80, 0x80, },
|
||||
};
|
||||
|
||||
#endif /* AVCODEC_INDEO2DATA_H */
|
||||
|
@ -17,8 +17,46 @@
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* **********************************************************************************************************************
|
||||
*
|
||||
*
|
||||
*
|
||||
* This source code incorporates work covered by the following copyright and
|
||||
* permission notice:
|
||||
*
|
||||
* Copyright (c) 2002-2007, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
|
||||
* Copyright (c) 2002-2007, Professor Benoit Macq
|
||||
* Copyright (c) 2001-2003, David Janssens
|
||||
* Copyright (c) 2002-2003, Yannick Verschueren
|
||||
* Copyright (c) 2003-2007, Francois-Olivier Devaux and Antonin Descampe
|
||||
* Copyright (c) 2005, Herve Drolon, FreeImage Team
|
||||
* Copyright (c) 2007, Callum Lerwick <seg@haxxed.com>
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* JPEG2000 image encoder
|
||||
* @file
|
||||
|
@ -352,6 +352,12 @@ static av_cold int libopenjpeg_encode_init(AVCodecContext *avctx)
|
||||
ctx->enc_params.cp_cinema = ctx->cinema_mode;
|
||||
#endif
|
||||
|
||||
if (!ctx->numresolution) {
|
||||
ctx->numresolution = 6;
|
||||
while (FFMIN(avctx->width, avctx->height) >> ctx->numresolution < 1)
|
||||
ctx->numresolution --;
|
||||
}
|
||||
|
||||
ctx->enc_params.mode = !!avctx->global_quality;
|
||||
ctx->enc_params.prog_order = ctx->prog_order;
|
||||
ctx->enc_params.numresolution = ctx->numresolution;
|
||||
@ -814,7 +820,7 @@ static const AVOption options[] = {
|
||||
{ "rpcl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(RPCL) }, 0, 0, VE, "prog_order" },
|
||||
{ "pcrl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(PCRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "cprl", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = OPJ(CPRL) }, 0, 0, VE, "prog_order" },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 6 }, 1, INT_MAX, VE },
|
||||
{ "numresolution", NULL, OFFSET(numresolution), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, VE },
|
||||
{ "numlayers", NULL, OFFSET(numlayers), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, 10, VE },
|
||||
{ "disto_alloc", NULL, OFFSET(disto_alloc), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, VE },
|
||||
{ "fixed_alloc", NULL, OFFSET(fixed_alloc), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, VE },
|
||||
|
@ -222,9 +222,19 @@ static int utvideo_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pic->data[0] = utv->buffer + utv->buf_size + pic->linesize[0];
|
||||
break;
|
||||
}
|
||||
pic->width = w;
|
||||
pic->height = h;
|
||||
pic->format = avctx->pix_fmt;
|
||||
|
||||
if (avctx->refcounted_frames) {
|
||||
int ret = av_frame_ref((AVFrame*)data, pic);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
} else {
|
||||
av_frame_move_ref((AVFrame*)data, pic);
|
||||
}
|
||||
|
||||
*got_frame = 1;
|
||||
av_frame_move_ref((AVFrame*)data, pic);
|
||||
|
||||
return avpkt->size;
|
||||
}
|
||||
|
@ -41,8 +41,9 @@ static av_cold int libwebp_anim_encode_init(AVCodecContext *avctx)
|
||||
int ret = ff_libwebp_encode_init_common(avctx);
|
||||
if (!ret) {
|
||||
LibWebPAnimContext *s = avctx->priv_data;
|
||||
WebPAnimEncoderOptions enc_options;
|
||||
WebPAnimEncoderOptions enc_options = { 0 };
|
||||
WebPAnimEncoderOptionsInit(&enc_options);
|
||||
enc_options.verbose = av_log_get_level() >= AV_LOG_VERBOSE;
|
||||
// TODO(urvang): Expose some options on command-line perhaps.
|
||||
s->enc = WebPAnimEncoderNew(avctx->width, avctx->height, &enc_options);
|
||||
if (!s->enc)
|
||||
|
@ -66,6 +66,7 @@
|
||||
#include "libavcodec/aacenc_utils.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
typedef struct BandCodingPath {
|
||||
int prev_idx;
|
||||
float cost;
|
||||
@ -2477,10 +2478,12 @@ static void search_for_ms_mips(AACEncContext *s, ChannelElement *cpe)
|
||||
|
||||
#include "libavcodec/aaccoder_trellis.h"
|
||||
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_aac_coder_init_mips(AACEncContext *c) {
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
AACCoefficientsEncoder *e = c->coder;
|
||||
int option = c->options.coder;
|
||||
|
||||
@ -2494,5 +2497,6 @@ void ff_aac_coder_init_mips(AACEncContext *c) {
|
||||
#if HAVE_MIPSFPU
|
||||
e->search_for_ms = search_for_ms_mips;
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -61,6 +61,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static inline float *VMUL2_mips(float *dst, const float *v, unsigned idx,
|
||||
const float *scale)
|
||||
{
|
||||
@ -246,6 +247,7 @@ static inline float *VMUL4S_mips(float *dst, const float *v, unsigned idx,
|
||||
#define VMUL4 VMUL4_mips
|
||||
#define VMUL2S VMUL2S_mips
|
||||
#define VMUL4S VMUL4S_mips
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
|
||||
|
||||
#endif /* AVCODEC_MIPS_AACDEC_MIPS_H */
|
||||
|
@ -188,6 +188,7 @@ static void ps_hybrid_synthesis_deint_mips(float out[2][38][64],
|
||||
}
|
||||
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void ps_add_squares_mips(float *dst, const float (*src)[2], int n)
|
||||
{
|
||||
int i;
|
||||
@ -442,6 +443,7 @@ static void ps_stereo_interpolate_mips(float (*l)[2], float (*r)[2],
|
||||
: "memory"
|
||||
);
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
@ -451,10 +453,12 @@ void ff_psdsp_init_mips(PSDSPContext *s)
|
||||
s->hybrid_analysis_ileave = ps_hybrid_analysis_ileave_mips;
|
||||
s->hybrid_synthesis_deint = ps_hybrid_synthesis_deint_mips;
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
s->add_squares = ps_add_squares_mips;
|
||||
s->mul_pair_single = ps_mul_pair_single_mips;
|
||||
s->decorrelate = ps_decorrelate_mips;
|
||||
s->stereo_interpolate[0] = ps_stereo_interpolate_mips;
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -59,6 +59,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM && HAVE_MIPSFPU && ( PSY_LAME_FIR_LEN == 21 )
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void calc_thr_3gpp_mips(const FFPsyWindowInfo *wi, const int num_bands,
|
||||
AacPsyChannel *pch, const uint8_t *band_sizes,
|
||||
const float *coefs, const int cutoff)
|
||||
@ -232,5 +233,6 @@ static void psy_hp_filter_mips(const float *firbuf, float *hpfsmpl, const float
|
||||
#define calc_thr_3gpp calc_thr_3gpp_mips
|
||||
#define psy_hp_filter psy_hp_filter_mips
|
||||
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
|
||||
#endif /* AVCODEC_MIPS_AACPSY_MIPS_H */
|
||||
|
@ -311,6 +311,7 @@ static int sbr_x_gen_mips(SpectralBandReplication *sbr, float X[2][38][64],
|
||||
}
|
||||
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void sbr_hf_assemble_mips(float Y1[38][64][2],
|
||||
const float X_high[64][40][2],
|
||||
SpectralBandReplication *sbr, SBRData *ch_data,
|
||||
@ -603,6 +604,7 @@ static void sbr_hf_inverse_filter_mips(SBRDSPContext *dsp,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
@ -612,8 +614,10 @@ void ff_aacsbr_func_ptr_init_mips(AACSBRContext *c)
|
||||
c->sbr_lf_gen = sbr_lf_gen_mips;
|
||||
c->sbr_x_gen = sbr_x_gen_mips;
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->sbr_hf_inverse_filter = sbr_hf_inverse_filter_mips;
|
||||
c->sbr_hf_assemble = sbr_hf_assemble_mips;
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -150,6 +150,7 @@ static void sbr_qmf_analysis_mips(AVFloatDSPContext *fdsp, FFTContext *mdct,
|
||||
}
|
||||
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void sbr_qmf_synthesis_mips(FFTContext *mdct,
|
||||
SBRDSPContext *sbrdsp, AVFloatDSPContext *fdsp,
|
||||
float *out, float X[2][38][64],
|
||||
@ -488,6 +489,7 @@ static void sbr_qmf_synthesis_mips(FFTContext *mdct,
|
||||
#define sbr_qmf_analysis sbr_qmf_analysis_mips
|
||||
#define sbr_qmf_synthesis sbr_qmf_synthesis_mips
|
||||
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
|
@ -201,6 +201,7 @@ static void ac3_update_bap_counts_mips(uint16_t mant_cnt[16], uint8_t *bap,
|
||||
#endif
|
||||
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void float_to_fixed24_mips(int32_t *dst, const float *src, unsigned int len)
|
||||
{
|
||||
const float scale = 1 << 24;
|
||||
@ -395,7 +396,8 @@ static void ac3_downmix_mips(float **samples, float (*matrix)[2],
|
||||
:"memory"
|
||||
);
|
||||
}
|
||||
#endif
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
|
||||
@ -405,9 +407,11 @@ void ff_ac3dsp_init_mips(AC3DSPContext *c, int bit_exact) {
|
||||
c->update_bap_counts = ac3_update_bap_counts_mips;
|
||||
#endif
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->float_to_fixed24 = float_to_fixed24_mips;
|
||||
c->downmix = ac3_downmix_mips;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void ff_acelp_interpolatef_mips(float *out, const float *in,
|
||||
const float *filter_coeffs, int precision,
|
||||
int frac_pos, int filter_length, int length)
|
||||
@ -206,12 +207,15 @@ static void ff_acelp_apply_order_2_transfer_function_mips(float *out, const floa
|
||||
"$f12", "$f13", "$f14", "$f15", "$f16", "memory"
|
||||
);
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_acelp_filter_init_mips(ACELPFContext *c)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->acelp_interpolatef = ff_acelp_interpolatef_mips;
|
||||
c->acelp_apply_order_2_transfer_function = ff_acelp_apply_order_2_transfer_function_mips;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -57,6 +57,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void ff_weighted_vector_sumf_mips(
|
||||
float *out, const float *in_a, const float *in_b,
|
||||
float weight_coeff_a, float weight_coeff_b, int length)
|
||||
@ -92,11 +93,14 @@ static void ff_weighted_vector_sumf_mips(
|
||||
: "$f0", "$f1", "$f2", "$f3", "$f4", "$f5", "memory"
|
||||
);
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_acelp_vectors_init_mips(ACELPVContext *c)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->weighted_vector_sumf = ff_weighted_vector_sumf_mips;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -54,6 +54,7 @@
|
||||
#include "amrwbdec_mips.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
void ff_hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
|
||||
float mem[HB_FIR_SIZE], const float *in)
|
||||
{
|
||||
@ -184,4 +185,5 @@ void ff_hb_fir_filter_mips(float *out, const float fir_coef[HB_FIR_SIZE + 1],
|
||||
}
|
||||
memcpy(mem, data + AMRWB_SFR_SIZE_16k, HB_FIR_SIZE * sizeof(float));
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
@ -54,9 +54,11 @@
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_MIPSFPU && HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
void ff_hb_fir_filter_mips(float *out, const float fir_coef[],
|
||||
float mem[], const float *in);
|
||||
#define hb_fir_filter ff_hb_fir_filter_mips
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_MIPS_AMRWBDEC_MIPS_H */
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void ff_celp_lp_synthesis_filterf_mips(float *out,
|
||||
const float *filter_coeffs,
|
||||
const float* in, int buffer_length,
|
||||
@ -278,12 +279,15 @@ static void ff_celp_lp_zero_synthesis_filterf_mips(float *out,
|
||||
out[n] = sum_out1;
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_celp_filter_init_mips(CELPFContext *c)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->celp_lp_synthesis_filterf = ff_celp_lp_synthesis_filterf_mips;
|
||||
c->celp_lp_zero_synthesis_filterf = ff_celp_lp_zero_synthesis_filterf_mips;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -56,6 +56,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static float ff_dot_productf_mips(const float* a, const float* b,
|
||||
int length)
|
||||
{
|
||||
@ -80,11 +81,14 @@ static float ff_dot_productf_mips(const float* a, const float* b,
|
||||
);
|
||||
return sum;
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_celp_math_init_mips(CELPMContext *c)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
c->dot_productf = ff_dot_productf_mips;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -58,6 +58,7 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void compute_antialias_mips_float(MPADecodeContext *s,
|
||||
GranuleDef *g)
|
||||
{
|
||||
@ -179,6 +180,7 @@ static void compute_antialias_mips_float(MPADecodeContext *s,
|
||||
);
|
||||
}
|
||||
#define compute_antialias compute_antialias_mips_float
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
#endif /* AVCODEC_MIPS_COMPUTE_ANTIALIAS_FLOAT_H */
|
||||
|
@ -57,6 +57,7 @@
|
||||
*/
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void ff_fft_calc_mips(FFTContext *s, FFTComplex *z)
|
||||
{
|
||||
int nbits, i, n, num_transforms, offset, step;
|
||||
@ -494,6 +495,7 @@ static void ff_imdct_calc_mips(FFTContext *s, FFTSample *output, const FFTSample
|
||||
output[n-k-4] = output[n2+k+3];
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
av_cold void ff_fft_init_mips(FFTContext *s)
|
||||
@ -504,10 +506,12 @@ av_cold void ff_fft_init_mips(FFTContext *s)
|
||||
ff_init_ff_cos_tabs(16);
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
s->fft_calc = ff_fft_calc_mips;
|
||||
#if CONFIG_MDCT
|
||||
s->imdct_calc = ff_imdct_calc_mips;
|
||||
s->imdct_half = ff_imdct_half_mips;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -55,6 +55,7 @@
|
||||
#include "libavcodec/iirfilter.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
typedef struct FFIIRFilterCoeffs {
|
||||
int order;
|
||||
float gain;
|
||||
@ -195,10 +196,13 @@ static void ff_iir_filter_flt_mips(const struct FFIIRFilterCoeffs *c,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_iir_filter_init_mips(FFIIRFilterContext *f) {
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
f->filter_flt = ff_iir_filter_flt_mips;
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -55,6 +55,7 @@
|
||||
#define AVCODEC_MIPS_LSP_MIPS_H
|
||||
|
||||
#if HAVE_MIPSFPU && HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
|
||||
static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, int lp_half_order)
|
||||
@ -107,5 +108,6 @@ static av_always_inline void ff_lsp2polyf_mips(const double *lsp, double *f, int
|
||||
}
|
||||
}
|
||||
#define ff_lsp2polyf ff_lsp2polyf_mips
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU && HAVE_INLINE_ASM */
|
||||
#endif /* AVCODEC_MIPS_LSP_MIPS_H */
|
||||
|
@ -57,6 +57,9 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
#include "libavcodec/mpegaudiodsp.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
|
||||
static void ff_mpadsp_apply_window_mips_fixed(int32_t *synth_buf, int32_t *window,
|
||||
int *dither_state, int16_t *samples, int incr)
|
||||
{
|
||||
@ -901,8 +904,15 @@ static void ff_imdct36_blocks_mips_fixed(int *out, int *buf, int *in,
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
void ff_mpadsp_init_mipsdsp(MPADSPContext *s)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
s->apply_window_fixed = ff_mpadsp_apply_window_mips_fixed;
|
||||
s->imdct36_blocks_fixed = ff_imdct36_blocks_mips_fixed;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -58,6 +58,9 @@
|
||||
#include "libavutil/mips/asmdefs.h"
|
||||
#include "libavcodec/mpegaudiodsp.h"
|
||||
|
||||
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
|
||||
static void ff_mpadsp_apply_window_mips_float(float *synth_buf, float *window,
|
||||
int *dither_state, float *samples, int incr)
|
||||
{
|
||||
@ -1243,9 +1246,16 @@ static void ff_imdct36_blocks_mips_float(float *out, float *buf, float *in,
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_INLINE_ASM && HAVE_MIPSFPU */
|
||||
|
||||
void ff_mpadsp_init_mipsfpu(MPADSPContext *s)
|
||||
{
|
||||
#if HAVE_INLINE_ASM && HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
s->apply_window_float = ff_mpadsp_apply_window_mips_float;
|
||||
s->imdct36_blocks_float = ff_imdct36_blocks_mips_float;
|
||||
s->dct32_float = ff_dct32_mips_float;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
@ -166,6 +166,7 @@ static void sbr_qmf_post_shuffle_mips(float W[32][2], const float *z)
|
||||
}
|
||||
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
static void sbr_sum64x5_mips(float *z)
|
||||
{
|
||||
int k;
|
||||
@ -882,6 +883,7 @@ static void sbr_hf_apply_noise_3_mips(float (*Y)[2], const float *s_m,
|
||||
phi_sign = -phi_sign;
|
||||
}
|
||||
}
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
@ -891,6 +893,7 @@ void ff_sbrdsp_init_mips(SBRDSPContext *s)
|
||||
s->qmf_pre_shuffle = sbr_qmf_pre_shuffle_mips;
|
||||
s->qmf_post_shuffle = sbr_qmf_post_shuffle_mips;
|
||||
#if HAVE_MIPSFPU
|
||||
#if !HAVE_MIPS32R6 && !HAVE_MIPS64R6
|
||||
s->sum64x5 = sbr_sum64x5_mips;
|
||||
s->sum_square = sbr_sum_square_mips;
|
||||
s->qmf_deint_bfly = sbr_qmf_deint_bfly_mips;
|
||||
@ -902,6 +905,7 @@ void ff_sbrdsp_init_mips(SBRDSPContext *s)
|
||||
s->hf_apply_noise[1] = sbr_hf_apply_noise_1_mips;
|
||||
s->hf_apply_noise[2] = sbr_hf_apply_noise_2_mips;
|
||||
s->hf_apply_noise[3] = sbr_hf_apply_noise_3_mips;
|
||||
#endif /* !HAVE_MIPS32R6 && !HAVE_MIPS64R6 */
|
||||
#endif /* HAVE_MIPSFPU */
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
}
|
||||
|
@ -1369,11 +1369,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
int mb_x, mb_y;
|
||||
int EOBRUN = 0;
|
||||
int c = s->comp_index[0];
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int last_scan = 0;
|
||||
int16_t *quant_matrix = s->quant_matrixes[s->quant_sindex[0]];
|
||||
int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
|
||||
av_assert0(ss>=0 && Ah>=0 && Al>=0);
|
||||
if (se < ss || se > 63) {
|
||||
@ -1381,20 +1377,13 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (!Al) {
|
||||
// s->coefs_finished is a bitmask for coefficients coded
|
||||
// ss and se are parameters telling start and end coefficients
|
||||
s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
|
||||
last_scan = !~s->coefs_finished[c];
|
||||
}
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
// s->coefs_finished is a bitmask for coefficients coded
|
||||
// ss and se are parameters telling start and end coefficients
|
||||
s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
|
||||
|
||||
s->restart_count = 0;
|
||||
|
||||
for (mb_y = 0; mb_y < s->mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
uint8_t *last_nnz = &s->last_nnz[c][block_idx];
|
||||
@ -1415,12 +1404,6 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (last_scan) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
if (handle_rstn(s, 0))
|
||||
EOBRUN = 0;
|
||||
}
|
||||
@ -1428,6 +1411,41 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void mjpeg_idct_scan_progressive_ac(MJpegDecodeContext *s)
|
||||
{
|
||||
int mb_x, mb_y;
|
||||
int c;
|
||||
const int bytes_per_pixel = 1 + (s->bits > 8);
|
||||
const int block_size = s->lossless ? 1 : 8;
|
||||
|
||||
for (c = 0; c < s->nb_components; c++) {
|
||||
uint8_t *data = s->picture_ptr->data[c];
|
||||
int linesize = s->linesize[c];
|
||||
int h = s->h_max / s->h_count[c];
|
||||
int v = s->v_max / s->v_count[c];
|
||||
int mb_width = (s->width + h * block_size - 1) / (h * block_size);
|
||||
int mb_height = (s->height + v * block_size - 1) / (v * block_size);
|
||||
|
||||
if (~s->coefs_finished[c])
|
||||
av_log(s->avctx, AV_LOG_WARNING, "component %d is incomplete\n", c);
|
||||
|
||||
if (s->interlaced && s->bottom_field)
|
||||
data += linesize >> 1;
|
||||
|
||||
for (mb_y = 0; mb_y < mb_height; mb_y++) {
|
||||
uint8_t *ptr = data + (mb_y * linesize * 8 >> s->avctx->lowres);
|
||||
int block_idx = mb_y * s->block_stride[c];
|
||||
int16_t (*block)[64] = &s->blocks[c][block_idx];
|
||||
for (mb_x = 0; mb_x < mb_width; mb_x++, block++) {
|
||||
s->idsp.idct_put(ptr, linesize, *block);
|
||||
if (s->bits & 7)
|
||||
shift_output(s, ptr, linesize);
|
||||
ptr += bytes_per_pixel*8 >> s->avctx->lowres;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ff_mjpeg_decode_sos(MJpegDecodeContext *s, const uint8_t *mb_bitmask,
|
||||
int mb_bitmask_size, const AVFrame *reference)
|
||||
{
|
||||
@ -2164,6 +2182,8 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
break;
|
||||
case EOI:
|
||||
eoi_parser:
|
||||
if (avctx->skip_frame != AVDISCARD_ALL && s->progressive && s->cur_scan && s->got_picture)
|
||||
mjpeg_idct_scan_progressive_ac(s);
|
||||
s->cur_scan = 0;
|
||||
if (!s->got_picture) {
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
|
@ -122,6 +122,16 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
|
||||
uint8_t *ptr;
|
||||
|
||||
if (avctx->sample_aspect_ratio.num > 0 && avctx->sample_aspect_ratio.den > 0) {
|
||||
AVRational sar = avctx->sample_aspect_ratio;
|
||||
|
||||
if (sar.num > 65535 || sar.den > 65535) {
|
||||
if (!av_reduce(&sar.num, &sar.den, avctx->sample_aspect_ratio.num, avctx->sample_aspect_ratio.den, 65535))
|
||||
av_log(avctx, AV_LOG_WARNING,
|
||||
"Cannot store exact aspect ratio %d:%d\n",
|
||||
avctx->sample_aspect_ratio.num,
|
||||
avctx->sample_aspect_ratio.den);
|
||||
}
|
||||
|
||||
/* JFIF header */
|
||||
put_marker(p, APP0);
|
||||
put_bits(p, 16, 16);
|
||||
@ -131,8 +141,8 @@ static void jpeg_put_comments(AVCodecContext *avctx, PutBitContext *p)
|
||||
* released revision. */
|
||||
put_bits(p, 16, 0x0102);
|
||||
put_bits(p, 8, 0); /* units type: 0 - aspect ratio */
|
||||
put_bits(p, 16, avctx->sample_aspect_ratio.num);
|
||||
put_bits(p, 16, avctx->sample_aspect_ratio.den);
|
||||
put_bits(p, 16, sar.num);
|
||||
put_bits(p, 16, sar.den);
|
||||
put_bits(p, 8, 0); /* thumbnail width */
|
||||
put_bits(p, 8, 0); /* thumbnail height */
|
||||
}
|
||||
|
@ -1216,6 +1216,8 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
}
|
||||
|
||||
ff_mpeg_unref_picture(s->avctx, &s->current_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
|
||||
/* release non reference frames */
|
||||
for (i = 0; i < MAX_PICTURE_COUNT; i++) {
|
||||
@ -1367,14 +1369,12 @@ int ff_mpv_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
memset(s->next_picture.f->data, 0, sizeof(s->next_picture.f->data));
|
||||
#endif
|
||||
if (s->last_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->last_picture);
|
||||
if (s->last_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->last_picture,
|
||||
s->last_picture_ptr)) < 0)
|
||||
return ret;
|
||||
}
|
||||
if (s->next_picture_ptr) {
|
||||
ff_mpeg_unref_picture(s->avctx, &s->next_picture);
|
||||
if (s->next_picture_ptr->f->buf[0] &&
|
||||
(ret = ff_mpeg_ref_picture(s->avctx, &s->next_picture,
|
||||
s->next_picture_ptr)) < 0)
|
||||
|
@ -354,8 +354,14 @@ static int parse_palette_segment(AVCodecContext *avctx,
|
||||
cb = bytestream_get_byte(&buf);
|
||||
alpha = bytestream_get_byte(&buf);
|
||||
|
||||
YUV_TO_RGB1(cb, cr);
|
||||
YUV_TO_RGB2(r, g, b, y);
|
||||
/* Default to BT.709 colorimetry. In case of <= 576 height use BT.601 */
|
||||
if (avctx->height <= 0 || avctx->height > 576) {
|
||||
YUV_TO_RGB1_CCIR_BT709(cb, cr);
|
||||
} else {
|
||||
YUV_TO_RGB1_CCIR(cb, cr);
|
||||
}
|
||||
|
||||
YUV_TO_RGB2_CCIR(r, g, b, y);
|
||||
|
||||
ff_dlog(avctx, "Color %d := (%d,%d,%d,%d)\n", color_id, r, g, b, alpha);
|
||||
|
||||
|
@ -1136,6 +1136,7 @@ static int decode_frame_common(AVCodecContext *avctx, PNGDecContext *s,
|
||||
case MKTAG('p', 'H', 'Y', 's'):
|
||||
case MKTAG('t', 'E', 'X', 't'):
|
||||
case MKTAG('I', 'D', 'A', 'T'):
|
||||
case MKTAG('t', 'R', 'N', 'S'):
|
||||
break;
|
||||
default:
|
||||
goto skip_tag;
|
||||
|
@ -291,12 +291,6 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
|
||||
short *output_bak = NULL;
|
||||
int lenout;
|
||||
|
||||
if (s->input_channels == s->output_channels && s->ratio == 1.0 && 0) {
|
||||
/* nothing to do */
|
||||
memcpy(output, input, nb_samples * s->input_channels * sizeof(short));
|
||||
return nb_samples;
|
||||
}
|
||||
|
||||
if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
|
||||
int istride[1] = { s->sample_size[0] };
|
||||
int ostride[1] = { 2 };
|
||||
|
@ -223,6 +223,12 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
ff_dlog(avctx, "pixel_size %d packed_size %d.\n", pixel_size, packed_size);
|
||||
|
||||
if (packed_size < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid tile size %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
|
||||
/* Get pixels buffer, it may be deflated or just raw */
|
||||
if (pixel_size == packed_size) {
|
||||
if (bytestream2_get_bytes_left(gbc) < pixel_size) {
|
||||
@ -233,6 +239,11 @@ static int rscc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
pixels = gbc->buffer;
|
||||
} else {
|
||||
uLongf len = ctx->inflated_size;
|
||||
if (bytestream2_get_bytes_left(gbc) < packed_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Insufficient input for %d\n", packed_size);
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto end;
|
||||
}
|
||||
ret = uncompress(ctx->inflated_buf, &len, gbc->buffer, packed_size);
|
||||
if (ret) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Pixel deflate error %d.\n", ret);
|
||||
|
@ -227,6 +227,7 @@ static void decode_lpc(int32_t *coeffs, int mode, int length)
|
||||
int a3 = coeffs[2];
|
||||
int a4 = a3 + a1;
|
||||
int a5 = a4 + a2;
|
||||
coeffs[2] = a5;
|
||||
coeffs += 3;
|
||||
for (i = 0; i < length - 3; i++) {
|
||||
a3 += *coeffs;
|
||||
|
@ -114,9 +114,12 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
{
|
||||
TTAEncContext *s = avctx->priv_data;
|
||||
PutBitContext pb;
|
||||
int ret, i, out_bytes, cur_chan = 0, res = 0, samples = 0;
|
||||
int ret, i, out_bytes, cur_chan, res, samples;
|
||||
int64_t pkt_size = frame->nb_samples * 2LL * avctx->channels * s->bps;
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, frame->nb_samples * 2 * avctx->channels * s->bps, 0)) < 0)
|
||||
pkt_alloc:
|
||||
cur_chan = 0, res = 0, samples = 0;
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, pkt_size, 0)) < 0)
|
||||
return ret;
|
||||
init_put_bits(&pb, avpkt->data, avpkt->size);
|
||||
|
||||
@ -174,6 +177,14 @@ static int tta_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
rice->k1++;
|
||||
|
||||
unary = 1 + (outval >> k);
|
||||
if (unary + 100LL > put_bits_left(&pb)) {
|
||||
if (pkt_size < INT_MAX/2) {
|
||||
pkt_size *= 2;
|
||||
av_packet_unref(avpkt);
|
||||
goto pkt_alloc;
|
||||
} else
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
do {
|
||||
if (unary > 31) {
|
||||
put_bits(&pb, 31, 0x7FFFFFFF);
|
||||
|
@ -658,7 +658,8 @@ static int rate_control(AVCodecContext *avctx, void *arg)
|
||||
VC2EncContext *s = slice_dat->ctx;
|
||||
const int sx = slice_dat->x;
|
||||
const int sy = slice_dat->y;
|
||||
int quant_buf[2], bits_buf[2], quant = s->q_start, range = s->q_start/3;
|
||||
int bits_last = INT_MAX, quant_buf[2] = {-1, -1};
|
||||
int quant = s->q_start, range = s->q_start/3;
|
||||
const int64_t top = slice_dat->bits_ceil;
|
||||
const double percent = s->tolerance;
|
||||
const double bottom = top - top*(percent/100.0f);
|
||||
@ -670,14 +671,13 @@ static int rate_control(AVCodecContext *avctx, void *arg)
|
||||
bits = count_hq_slice(s, sx, sy, quant);
|
||||
range = av_clip(range/2, 1, s->q_ceil);
|
||||
if (quant_buf[1] == quant) {
|
||||
quant = bits_buf[0] < bits ? quant_buf[0] : quant;
|
||||
bits = bits_buf[0] < bits ? bits_buf[0] : bits;
|
||||
quant = bits_last < bits ? quant_buf[0] : quant;
|
||||
bits = bits_last < bits ? bits_last : bits;
|
||||
break;
|
||||
}
|
||||
quant_buf[1] = quant_buf[0];
|
||||
quant_buf[0] = quant;
|
||||
bits_buf[1] = bits_buf[0];
|
||||
bits_buf[0] = bits;
|
||||
bits_last = bits;
|
||||
}
|
||||
slice_dat->quant_idx = av_clip(quant, 0, s->q_ceil);
|
||||
slice_dat->bytes = FFALIGN((bits >> 3), s->size_scaler) + 4 + s->prefix_bytes;
|
||||
@ -867,7 +867,7 @@ static int dwt_plane(AVCodecContext *avctx, void *arg)
|
||||
}
|
||||
}
|
||||
|
||||
memset(buf, 0, (p->coef_stride*p->dwt_height - p->height*p->width)*sizeof(dwtcoef));
|
||||
memset(buf, 0, p->coef_stride * (p->dwt_height - p->height) * sizeof(dwtcoef));
|
||||
|
||||
for (level = s->wavelet_depth-1; level >= 0; level--) {
|
||||
const SubBand *b = &p->band[level][0];
|
||||
|
@ -753,6 +753,10 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
|
||||
c->transform_add[3] = ff_hevc_transform_add32_8_avx;
|
||||
}
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_8_avx2;
|
||||
c->sao_band_filter[1] = ff_hevc_sao_band_filter_16_8_avx2;
|
||||
}
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
c->idct_dc[2] = ff_hevc_idct16x16_dc_8_avx2;
|
||||
c->idct_dc[3] = ff_hevc_idct32x32_dc_8_avx2;
|
||||
if (ARCH_X86_64) {
|
||||
@ -897,7 +901,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
|
||||
SAO_BAND_INIT(10, avx);
|
||||
}
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
|
||||
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_10_avx2;
|
||||
}
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
c->idct_dc[2] = ff_hevc_idct16x16_dc_10_avx2;
|
||||
c->idct_dc[3] = ff_hevc_idct32x32_dc_10_avx2;
|
||||
if (ARCH_X86_64) {
|
||||
@ -1095,6 +1101,9 @@ void ff_hevc_dsp_init_x86(HEVCDSPContext *c, const int bit_depth)
|
||||
SAO_BAND_INIT(12, avx);
|
||||
}
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
c->sao_band_filter[0] = ff_hevc_sao_band_filter_8_12_avx2;
|
||||
}
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
c->idct_dc[2] = ff_hevc_idct16x16_dc_12_avx2;
|
||||
c->idct_dc[3] = ff_hevc_idct32x32_dc_12_avx2;
|
||||
|
||||
|
@ -98,7 +98,7 @@ av_cold void ff_huffyuvencdsp_init_x86(HuffYUVEncDSPContext *c)
|
||||
c->diff_bytes = ff_diff_bytes_sse2;
|
||||
}
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
c->diff_bytes = ff_diff_bytes_avx2;
|
||||
}
|
||||
}
|
||||
|
@ -44,7 +44,7 @@ av_cold void ff_jpeg2000dsp_init_x86(Jpeg2000DSPContext *c)
|
||||
c->mct_decode[FF_DWT97] = ff_ict_float_avx;
|
||||
}
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
c->mct_decode[FF_DWT53] = ff_rct_int_avx2;
|
||||
}
|
||||
}
|
||||
|
@ -199,6 +199,6 @@ av_cold void ff_mlpdsp_init_x86(MLPDSPContext *c)
|
||||
#endif
|
||||
if (ARCH_X86_64 && EXTERNAL_SSE4(cpu_flags))
|
||||
c->mlp_rematrix_channel = ff_mlp_rematrix_channel_sse4;
|
||||
if (ARCH_X86_64 && EXTERNAL_AVX2(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
|
||||
if (ARCH_X86_64 && EXTERNAL_AVX2_FAST(cpu_flags) && cpu_flags & AV_CPU_FLAG_BMI2)
|
||||
c->mlp_rematrix_channel = ff_mlp_rematrix_channel_avx2_bmi2;
|
||||
}
|
||||
|
@ -67,7 +67,7 @@ av_cold void ff_synth_filter_init_x86(SynthFilterContext *s)
|
||||
if (EXTERNAL_AVX_FAST(cpu_flags)) {
|
||||
s->synth_filter_float = synth_filter_avx;
|
||||
}
|
||||
if (EXTERNAL_FMA3(cpu_flags) && !(cpu_flags & AV_CPU_FLAG_AVXSLOW)) {
|
||||
if (EXTERNAL_FMA3_FAST(cpu_flags)) {
|
||||
s->synth_filter_float = synth_filter_fma3;
|
||||
}
|
||||
#endif /* HAVE_YASM */
|
||||
|
@ -45,7 +45,7 @@ av_cold void ff_v210enc_init_x86(V210EncContext *s)
|
||||
if (EXTERNAL_AVX(cpu_flags))
|
||||
s->pack_line_8 = ff_v210_planar_pack_8_avx;
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
s->pack_line_8 = ff_v210_planar_pack_8_avx2;
|
||||
s->pack_line_10 = ff_v210_planar_pack_10_avx2;
|
||||
s->sample_factor = 2;
|
||||
|
@ -377,7 +377,7 @@ av_cold void ff_vp9dsp_init_x86(VP9DSPContext *dsp, int bpp, int bitexact)
|
||||
init_ipred(32, avx, v, VERT);
|
||||
}
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
init_fpel_func(1, 1, 32, avg, _8, avx2);
|
||||
init_fpel_func(0, 1, 64, avg, _8, avx2);
|
||||
if (ARCH_X86_64) {
|
||||
|
@ -129,7 +129,7 @@ av_cold void ff_vp9dsp_init_16bpp_x86(VP9DSPContext *dsp)
|
||||
init_ipred_funcs(hd, HOR_DOWN, 16, avx);
|
||||
}
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
init_fpel_func(2, 1, 32, avg, _16, avx2);
|
||||
init_fpel_func(1, 1, 64, avg, _16, avx2);
|
||||
init_fpel_func(0, 1, 128, avg, _16, avx2);
|
||||
|
@ -225,7 +225,7 @@ av_cold void INIT_FUNC(VP9DSPContext *dsp, int bitexact)
|
||||
init_lpf_funcs(BPC, avx);
|
||||
}
|
||||
|
||||
if (EXTERNAL_AVX2(cpu_flags)) {
|
||||
if (EXTERNAL_AVX2_FAST(cpu_flags)) {
|
||||
#if HAVE_AVX2_EXTERNAL
|
||||
init_subpel3_32_64(0, put, BPC, avx2);
|
||||
init_subpel3_32_64(1, avg, BPC, avx2);
|
||||
|
@ -240,7 +240,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
|
||||
timestamp = movie->seek_point;
|
||||
// add the stream start time, should it exist
|
||||
if (movie->format_ctx->start_time != AV_NOPTS_VALUE) {
|
||||
if (timestamp > INT64_MAX - movie->format_ctx->start_time) {
|
||||
if (timestamp > 0 && movie->format_ctx->start_time > INT64_MAX - timestamp) {
|
||||
av_log(ctx, AV_LOG_ERROR,
|
||||
"%s: seek value overflow with start_time:%"PRId64" seek_point:%"PRId64"\n",
|
||||
movie->file_name, movie->format_ctx->start_time, movie->seek_point);
|
||||
|
@ -1222,7 +1222,9 @@ static int draw_text(AVFilterContext *ctx, AVFrame *frame,
|
||||
dummy.code = code;
|
||||
glyph = av_tree_find(s->glyphs, &dummy, glyph_cmp, NULL);
|
||||
if (!glyph) {
|
||||
load_glyph(ctx, &glyph, code);
|
||||
ret = load_glyph(ctx, &glyph, code);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
y_min = FFMIN(glyph->bbox.yMin, y_min);
|
||||
|
@ -1695,6 +1695,8 @@ static int guess_ni_flag(AVFormatContext *s)
|
||||
size = avio_rl32(s->pb);
|
||||
if (get_stream_idx(tag) == i && pos + size > st->index_entries[1].pos)
|
||||
last_start = INT64_MAX;
|
||||
if (get_stream_idx(tag) == i && size == st->index_entries[0].size + 8)
|
||||
last_start = INT64_MAX;
|
||||
}
|
||||
|
||||
if (st->index_entries[0].pos > last_start)
|
||||
|
@ -283,6 +283,12 @@ resolve_eof:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int enu_free(void *opaque, void *elem)
|
||||
{
|
||||
av_free(elem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int cache_close(URLContext *h)
|
||||
{
|
||||
Context *c= h->priv_data;
|
||||
@ -292,6 +298,7 @@ static int cache_close(URLContext *h)
|
||||
|
||||
close(c->fd);
|
||||
ffurl_close(c->inner);
|
||||
av_tree_enumerate(c->root, NULL, NULL, enu_free);
|
||||
av_tree_destroy(c->root);
|
||||
|
||||
return 0;
|
||||
|
@ -710,7 +710,7 @@ static int concat_seek(AVFormatContext *avf, int stream,
|
||||
|
||||
static const AVOption options[] = {
|
||||
{ "safe", "enable safe mode",
|
||||
OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = -1}, -1, 1, DEC },
|
||||
OFFSET(safe), AV_OPT_TYPE_BOOL, {.i64 = 1}, -1, 1, DEC },
|
||||
{ "auto_convert", "automatically convert bitstream format",
|
||||
OFFSET(auto_convert), AV_OPT_TYPE_BOOL, {.i64 = 1}, 0, 1, DEC },
|
||||
{ "segment_time_metadata", "output file segment start time and duration as packet metadata",
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/avassert.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/pixdesc.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "ffm.h"
|
||||
@ -377,6 +378,11 @@ static int ffm2_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
@ -569,6 +575,11 @@ static int ffm_read_header(AVFormatContext *s)
|
||||
codec->height = avio_rb16(pb);
|
||||
codec->gop_size = avio_rb16(pb);
|
||||
codec->pix_fmt = avio_rb32(pb);
|
||||
if (!av_pix_fmt_desc_get(codec->pix_fmt)) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid pix fmt id: %d\n", codec->pix_fmt);
|
||||
codec->pix_fmt = AV_PIX_FMT_NONE;
|
||||
goto fail;
|
||||
}
|
||||
codec->qmin = avio_r8(pb);
|
||||
codec->qmax = avio_r8(pb);
|
||||
codec->max_qdiff = avio_r8(pb);
|
||||
@ -775,8 +786,8 @@ static int ffm_probe(AVProbeData *p)
|
||||
|
||||
static const AVOption options[] = {
|
||||
{"server_attached", NULL, offsetof(FFMContext, server_attached), AV_OPT_TYPE_BOOL, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
|
||||
{"ffm_write_index", NULL, offsetof(FFMContext, write_index), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
|
||||
{"ffm_file_size", NULL, offsetof(FFMContext, file_size), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, 1, AV_OPT_FLAG_EXPORT },
|
||||
{"ffm_write_index", NULL, offsetof(FFMContext, write_index), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_EXPORT },
|
||||
{"ffm_file_size", NULL, offsetof(FFMContext, file_size), AV_OPT_TYPE_INT64, {.i64 = 0}, 0, INT64_MAX, AV_OPT_FLAG_EXPORT },
|
||||
{ NULL },
|
||||
};
|
||||
|
||||
|
@ -349,7 +349,7 @@ URLProtocol ff_file_protocol = {
|
||||
.url_open_dir = file_open_dir,
|
||||
.url_read_dir = file_read_dir,
|
||||
.url_close_dir = file_close_dir,
|
||||
.default_whitelist = "file"
|
||||
.default_whitelist = "file,crypto"
|
||||
};
|
||||
|
||||
#endif /* CONFIG_FILE_PROTOCOL */
|
||||
@ -388,7 +388,7 @@ URLProtocol ff_pipe_protocol = {
|
||||
.url_check = file_check,
|
||||
.priv_data_size = sizeof(FileContext),
|
||||
.priv_data_class = &pipe_class,
|
||||
.default_whitelist = "none"
|
||||
.default_whitelist = "crypto"
|
||||
};
|
||||
|
||||
#endif /* CONFIG_PIPE_PROTOCOL */
|
||||
|
@ -396,7 +396,7 @@ static int hls_window(AVFormatContext *s, int last)
|
||||
|
||||
set_http_options(&options, hls);
|
||||
snprintf(temp_filename, sizeof(temp_filename), use_rename ? "%s.tmp" : "%s", s->filename);
|
||||
if ((ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, NULL)) < 0)
|
||||
if ((ret = s->io_open(s, &out, temp_filename, AVIO_FLAG_WRITE, &options)) < 0)
|
||||
goto fail;
|
||||
|
||||
for (en = hls->segments; en; en = en->next) {
|
||||
|
@ -1522,7 +1522,7 @@ URLProtocol ff_http_protocol = {
|
||||
.priv_data_size = sizeof(HTTPContext),
|
||||
.priv_data_class = &http_context_class,
|
||||
.flags = URL_PROTOCOL_FLAG_NETWORK,
|
||||
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto"
|
||||
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto,httpproxy"
|
||||
};
|
||||
#endif /* CONFIG_HTTP_PROTOCOL */
|
||||
|
||||
@ -1541,7 +1541,7 @@ URLProtocol ff_https_protocol = {
|
||||
.priv_data_size = sizeof(HTTPContext),
|
||||
.priv_data_class = &https_context_class,
|
||||
.flags = URL_PROTOCOL_FLAG_NETWORK,
|
||||
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto"
|
||||
.default_whitelist = "http,https,tls,rtp,tcp,udp,crypto,httpproxy"
|
||||
};
|
||||
#endif /* CONFIG_HTTPS_PROTOCOL */
|
||||
|
||||
|
@ -193,6 +193,8 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
|
||||
|
||||
if (sep)
|
||||
p = sep + 1;
|
||||
else
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ctx->playpath) {
|
||||
|
@ -3609,7 +3609,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
}
|
||||
av_log(c->fc, AV_LOG_DEBUG, "calculated into dts %"PRId64"\n", dts);
|
||||
} else {
|
||||
dts = frag->time;
|
||||
dts = frag->time - sc->time_offset;
|
||||
av_log(c->fc, AV_LOG_DEBUG, "found frag time %"PRId64
|
||||
", using it for dts\n", dts);
|
||||
}
|
||||
@ -3666,7 +3666,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
version = avio_r8(pb);
|
||||
if (version > 1) {
|
||||
avpriv_request_sample(c->fc, "sidx version %u", version);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
return 0;
|
||||
}
|
||||
|
||||
avio_rb24(pb); // flags
|
||||
@ -3679,8 +3679,8 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
}
|
||||
}
|
||||
if (!st) {
|
||||
av_log(c->fc, AV_LOG_ERROR, "could not find corresponding track id %d\n", track_id);
|
||||
return AVERROR_INVALIDDATA;
|
||||
av_log(c->fc, AV_LOG_WARNING, "could not find corresponding track id %d\n", track_id);
|
||||
return 0;
|
||||
}
|
||||
|
||||
sc = st->priv_data;
|
||||
|
@ -2441,7 +2441,7 @@ static int mpegts_probe(AVProbeData *p)
|
||||
#define CHECK_COUNT 10
|
||||
#define CHECK_BLOCK 100
|
||||
|
||||
if (check_count < CHECK_COUNT)
|
||||
if (!check_count)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i<check_count; i+=CHECK_BLOCK) {
|
||||
@ -2459,10 +2459,15 @@ static int mpegts_probe(AVProbeData *p)
|
||||
|
||||
ff_dlog(0, "TS score: %d %d\n", sumscore, maxscore);
|
||||
|
||||
if (sumscore > 6) return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
|
||||
else if (maxscore > 6) return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
|
||||
else
|
||||
if (check_count >= CHECK_COUNT && sumscore > 6) {
|
||||
return AVPROBE_SCORE_MAX + sumscore - CHECK_COUNT;
|
||||
} else if (check_count >= CHECK_COUNT && maxscore > 6) {
|
||||
return AVPROBE_SCORE_MAX/2 + sumscore - CHECK_COUNT;
|
||||
} else if (sumscore > 6) {
|
||||
return 2;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* return the 90kHz PCR and the extension for the 27MHz PCR. return
|
||||
|
@ -56,6 +56,7 @@ typedef struct MpegTSService {
|
||||
int pcr_pid;
|
||||
int pcr_packet_count;
|
||||
int pcr_packet_period;
|
||||
AVProgram *program;
|
||||
} MpegTSService;
|
||||
|
||||
// service_type values as defined in ETSI 300 468
|
||||
@ -275,15 +276,12 @@ static int mpegts_write_pmt(AVFormatContext *s, MpegTSService *service)
|
||||
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
|
||||
|
||||
if (s->nb_programs) {
|
||||
int j, k, found = 0;
|
||||
int k, found = 0;
|
||||
AVProgram *program = service->program;
|
||||
|
||||
for (j = 0; j < s->nb_programs; j++)
|
||||
if (s->programs[j]->id == service->sid) {
|
||||
for (k = 0; k < s->programs[j]->nb_stream_indexes; k++)
|
||||
if (s->programs[j]->stream_index[k] == i) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
for (k = 0; k < program->nb_stream_indexes; k++)
|
||||
if (program->stream_index[k] == i) {
|
||||
found = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -784,6 +782,7 @@ static int mpegts_init(AVFormatContext *s)
|
||||
service->pmt.write_packet = section_write_packet;
|
||||
service->pmt.opaque = s;
|
||||
service->pmt.cc = 15;
|
||||
service->program = program;
|
||||
}
|
||||
}
|
||||
|
||||
@ -807,6 +806,7 @@ static int mpegts_init(AVFormatContext *s)
|
||||
|
||||
/* assign pids to each stream */
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVProgram *program;
|
||||
st = s->streams[i];
|
||||
|
||||
ts_st = av_mallocz(sizeof(MpegTSWriteStream));
|
||||
@ -824,6 +824,17 @@ static int mpegts_init(AVFormatContext *s)
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
program = av_find_program_from_stream(s, NULL, i);
|
||||
if (program) {
|
||||
for (j = 0; j < ts->nb_services; j++) {
|
||||
if (ts->services[j]->program == program) {
|
||||
service = ts->services[j];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ts_st->service = service;
|
||||
/* MPEG pid values < 16 are reserved. Applications which set st->id in
|
||||
* this range are assigned a calculated pid. */
|
||||
|
@ -400,7 +400,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
}
|
||||
|
||||
if (s->oformat->init && (ret = s->oformat->init(s)) < 0) {
|
||||
s->oformat->deinit(s);
|
||||
if (s->oformat->deinit)
|
||||
s->oformat->deinit(s);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -701,6 +701,7 @@ static int ogg_read_header(AVFormatContext *s)
|
||||
if (ogg->streams[i].header < 0) {
|
||||
av_log(s, AV_LOG_ERROR, "Header parsing failed for stream %d\n", i);
|
||||
ogg->streams[i].codec = NULL;
|
||||
av_freep(&ogg->streams[i].private);
|
||||
} else if (os->codec && os->nb_header < os->codec->nb_header) {
|
||||
av_log(s, AV_LOG_WARNING,
|
||||
"Headers mismatch for stream %d: "
|
||||
|
@ -117,6 +117,10 @@ static int opus_packet(AVFormatContext *avf, int idx)
|
||||
|
||||
if (!os->psize)
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (os->granule > (1LL << 62)) {
|
||||
av_log(avf, AV_LOG_ERROR, "Unsupported huge granule pos %"PRId64 "\n", os->granule);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if ((!os->lastpts || os->lastpts == AV_NOPTS_VALUE) && !(os->flags & OGG_FLAG_EOS)) {
|
||||
int seg, d;
|
||||
|
@ -82,7 +82,11 @@ static uint64_t vp8_gptopts(AVFormatContext *s, int idx,
|
||||
struct ogg *ogg = s->priv_data;
|
||||
struct ogg_stream *os = ogg->streams + idx;
|
||||
|
||||
uint64_t pts = (granule >> 32);
|
||||
int invcnt = !((granule >> 30) & 3);
|
||||
// If page granule is that of an invisible vp8 frame, its pts will be
|
||||
// that of the end of the next visible frame. We substract 1 for those
|
||||
// to prevent messing up pts calculations.
|
||||
uint64_t pts = (granule >> 32) - invcnt;
|
||||
uint32_t dist = (granule >> 3) & 0x07ffffff;
|
||||
|
||||
if (!dist)
|
||||
|
@ -87,6 +87,7 @@ static const AVOption avformat_options[] = {
|
||||
{"max_interleave_delta", "maximum buffering duration for interleaving", OFFSET(max_interleave_delta), AV_OPT_TYPE_INT64, { .i64 = 10000000 }, 0, INT64_MAX, E },
|
||||
{"f_strict", "how strictly to follow the standards (deprecated; use strict, save via avconv)", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"strict", "how strictly to follow the standards", OFFSET(strict_std_compliance), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"very", "strictly conform to a older more strict version of the spec or reference software", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_VERY_STRICT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"strict", "strictly conform to all the things in the spec no matter what the consequences", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_STRICT }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"normal", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_NORMAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
{"unofficial", "allow unofficial extensions", 0, AV_OPT_TYPE_CONST, {.i64 = FF_COMPLIANCE_UNOFFICIAL }, INT_MIN, INT_MAX, D|E, "strict"},
|
||||
|
@ -193,16 +193,17 @@ static void create_default_qtables(uint8_t *qtables, uint8_t q)
|
||||
{
|
||||
int factor = q;
|
||||
int i;
|
||||
uint16_t S;
|
||||
|
||||
factor = av_clip(q, 1, 99);
|
||||
|
||||
if (q < 50)
|
||||
q = 5000 / factor;
|
||||
S = 5000 / factor;
|
||||
else
|
||||
q = 200 - factor * 2;
|
||||
S = 200 - factor * 2;
|
||||
|
||||
for (i = 0; i < 128; i++) {
|
||||
int val = (default_quantizers[i] * q + 50) / 100;
|
||||
int val = (default_quantizers[i] * S + 50) / 100;
|
||||
|
||||
/* Limit the quantizers to 1 <= q <= 255. */
|
||||
val = av_clip(val, 1, 255);
|
||||
|
@ -271,7 +271,8 @@ static void rtcp_send_sr(AVFormatContext *s1, int64_t ntp_time, int bye)
|
||||
avio_w8(s1->pb, RTCP_SR);
|
||||
avio_wb16(s1->pb, 6); /* length in words - 1 */
|
||||
avio_wb32(s1->pb, s->ssrc);
|
||||
avio_wb64(s1->pb, NTP_TO_RTP_FORMAT(ntp_time));
|
||||
avio_wb32(s1->pb, ntp_time / 1000000);
|
||||
avio_wb32(s1->pb, ((ntp_time % 1000000) << 32) / 1000000);
|
||||
avio_wb32(s1->pb, rtp_ts);
|
||||
avio_wb32(s1->pb, s->packet_count);
|
||||
avio_wb32(s1->pb, s->octet_count);
|
||||
|
@ -48,7 +48,7 @@ static int svag_read_header(AVFormatContext *s)
|
||||
if (st->codec->sample_rate <= 0)
|
||||
return AVERROR_INVALIDDATA;
|
||||
st->codec->channels = avio_rl32(s->pb);
|
||||
if (st->codec->channels <= 0)
|
||||
if (st->codec->channels <= 0 || st->codec->channels > 8)
|
||||
return AVERROR_INVALIDDATA;
|
||||
st->duration = size / (16 * st->codec->channels) * 28;
|
||||
align = avio_rl32(s->pb);
|
||||
|
@ -1186,12 +1186,13 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
|
||||
}
|
||||
}
|
||||
|
||||
if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY && has_decode_delay_been_guessed(st)) {
|
||||
if (pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY) {
|
||||
st->pts_buffer[0] = pkt->pts;
|
||||
for (i = 0; i<delay && st->pts_buffer[i] > st->pts_buffer[i + 1]; i++)
|
||||
FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i + 1]);
|
||||
|
||||
pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
|
||||
if(has_decode_delay_been_guessed(st))
|
||||
pkt->dts = select_from_pts_buffer(st, st->pts_buffer, pkt->dts);
|
||||
}
|
||||
// We skipped it above so we try here.
|
||||
if (!onein_oneout)
|
||||
@ -2369,7 +2370,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
||||
end_time1 = av_rescale_q_rnd(st->duration, st->time_base,
|
||||
AV_TIME_BASE_Q,
|
||||
AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX);
|
||||
if (end_time1 != AV_NOPTS_VALUE) {
|
||||
if (end_time1 != AV_NOPTS_VALUE && start_time1 <= INT64_MAX - end_time1) {
|
||||
end_time1 += start_time1;
|
||||
end_time = FFMAX(end_time, end_time1);
|
||||
}
|
||||
@ -2407,7 +2408,7 @@ static void update_stream_timings(AVFormatContext *ic)
|
||||
if (duration != INT64_MIN && duration > 0 && ic->duration == AV_NOPTS_VALUE) {
|
||||
ic->duration = duration;
|
||||
}
|
||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration != AV_NOPTS_VALUE) {
|
||||
if (ic->pb && (filesize = avio_size(ic->pb)) > 0 && ic->duration > 0) {
|
||||
/* compute the bitrate */
|
||||
double bitrate = (double) filesize * 8.0 * AV_TIME_BASE /
|
||||
(double) ic->duration;
|
||||
@ -2832,6 +2833,9 @@ enum AVCodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
|
||||
|
||||
enum AVCodecID ff_get_pcm_codec_id(int bps, int flt, int be, int sflags)
|
||||
{
|
||||
if (bps <= 0 || bps > 64)
|
||||
return AV_CODEC_ID_NONE;
|
||||
|
||||
if (flt) {
|
||||
switch (bps) {
|
||||
case 32:
|
||||
@ -2915,7 +2919,7 @@ static void compute_chapters_end(AVFormatContext *s)
|
||||
unsigned int i, j;
|
||||
int64_t max_time = 0;
|
||||
|
||||
if (s->duration > 0)
|
||||
if (s->duration > 0 && s->start_time < INT64_MAX - s->duration)
|
||||
max_time = s->duration +
|
||||
((s->start_time == AV_NOPTS_VALUE) ? 0 : s->start_time);
|
||||
|
||||
|
@ -94,7 +94,7 @@ static const struct {
|
||||
{ "6.0(front)", 6, AV_CH_LAYOUT_6POINT0_FRONT },
|
||||
{ "hexagonal", 6, AV_CH_LAYOUT_HEXAGONAL },
|
||||
{ "6.1", 7, AV_CH_LAYOUT_6POINT1 },
|
||||
{ "6.1", 7, AV_CH_LAYOUT_6POINT1_BACK },
|
||||
{ "6.1(back)", 7, AV_CH_LAYOUT_6POINT1_BACK },
|
||||
{ "6.1(front)", 7, AV_CH_LAYOUT_6POINT1_FRONT },
|
||||
{ "7.0", 7, AV_CH_LAYOUT_7POINT0 },
|
||||
{ "7.0(front)", 7, AV_CH_LAYOUT_7POINT0_FRONT },
|
||||
|
@ -41,6 +41,16 @@
|
||||
b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
|
||||
}
|
||||
|
||||
#define YUV_TO_RGB1_CCIR_BT709(cb1, cr1)\
|
||||
{\
|
||||
cb = (cb1) - 128;\
|
||||
cr = (cr1) - 128;\
|
||||
r_add = FIX(1.5747*255.0/224.0) * cr + ONE_HALF;\
|
||||
g_add = - FIX(0.1873*255.0/224.0) * cb - FIX(0.4682*255.0/224.0) * cr + \
|
||||
ONE_HALF;\
|
||||
b_add = FIX(1.8556*255.0/224.0) * cb + ONE_HALF;\
|
||||
}
|
||||
|
||||
#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
|
||||
{\
|
||||
y = ((y1) - 16) * FIX(255.0/219.0);\
|
||||
|
@ -24,13 +24,16 @@
|
||||
#define CPUEXT_SUFFIX(flags, suffix, cpuext) \
|
||||
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext))
|
||||
|
||||
#define CPUEXT_SUFFIX_FAST(flags, suffix, cpuext) \
|
||||
#define CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, slow_cpuext) \
|
||||
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \
|
||||
!((flags) & AV_CPU_FLAG_ ## cpuext ## SLOW))
|
||||
!((flags) & AV_CPU_FLAG_ ## slow_cpuext ## SLOW))
|
||||
|
||||
#define CPUEXT_SUFFIX_SLOW(flags, suffix, cpuext) \
|
||||
#define CPUEXT_SUFFIX_SLOW2(flags, suffix, cpuext, slow_cpuext) \
|
||||
(HAVE_ ## cpuext ## suffix && ((flags) & AV_CPU_FLAG_ ## cpuext) && \
|
||||
((flags) & AV_CPU_FLAG_ ## cpuext ## SLOW))
|
||||
((flags) & AV_CPU_FLAG_ ## slow_cpuext ## SLOW))
|
||||
|
||||
#define CPUEXT_SUFFIX_FAST(flags, suffix, cpuext) CPUEXT_SUFFIX_FAST2(flags, suffix, cpuext, cpuext)
|
||||
#define CPUEXT_SUFFIX_SLOW(flags, suffix, cpuext) CPUEXT_SUFFIX_SLOW2(flags, suffix, cpuext, cpuext)
|
||||
|
||||
#define CPUEXT(flags, cpuext) CPUEXT_SUFFIX(flags, , cpuext)
|
||||
#define CPUEXT_FAST(flags, cpuext) CPUEXT_SUFFIX_FAST(flags, , cpuext)
|
||||
|
@ -313,6 +313,22 @@ static av_always_inline float ff_exp10f(float x)
|
||||
return exp2f(M_LOG2_10 * x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute x^y for floating point x, y. Note: this function is faster than the
|
||||
* libm variant due to mainly 2 reasons:
|
||||
* 1. It does not handle any edge cases. In particular, this is only guaranteed
|
||||
* to work correctly for x > 0.
|
||||
* 2. It is not as accurate as a standard nearly "correctly rounded" libm variant.
|
||||
* @param x base
|
||||
* @param y exponent
|
||||
* @return x^y
|
||||
*/
|
||||
static av_always_inline float ff_fast_powf(float x, float y)
|
||||
{
|
||||
return expf(logf(x) * y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A wrapper for open() setting O_CLOEXEC.
|
||||
*/
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user