Compare commits
87 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
930d035e72 | ||
![]() |
875649bfae | ||
![]() |
70127070dd | ||
![]() |
d83ab33715 | ||
![]() |
06190d75d0 | ||
![]() |
c9ea1f7fc5 | ||
![]() |
47de8ccf42 | ||
![]() |
72c1de649a | ||
![]() |
5e3e67f977 | ||
![]() |
221bbd002c | ||
![]() |
fffc9316da | ||
![]() |
9a87ba0933 | ||
![]() |
d8538a1002 | ||
![]() |
6cb33e0763 | ||
![]() |
2e75c45593 | ||
![]() |
ba4cb43f0b | ||
![]() |
dc73774792 | ||
![]() |
ce11d9490c | ||
![]() |
430ef8a716 | ||
![]() |
627772d988 | ||
![]() |
5ce57e0248 | ||
![]() |
5effd65312 | ||
![]() |
cb340ecd7d | ||
![]() |
b88bea1d6c | ||
![]() |
99036565ca | ||
![]() |
fcc6460dbf | ||
![]() |
1065d4197e | ||
![]() |
fbb1af39e4 | ||
![]() |
073bde2b1f | ||
![]() |
e4bb67bc50 | ||
![]() |
59549b5ab7 | ||
![]() |
c0445df5b3 | ||
![]() |
c77b3737b9 | ||
![]() |
04d6946600 | ||
![]() |
ae93d3405e | ||
![]() |
054779625f | ||
![]() |
e22dd7fbd0 | ||
![]() |
376a9f8e6e | ||
![]() |
9af68f8d1f | ||
![]() |
f2361593ca | ||
![]() |
96e6d4da37 | ||
![]() |
735deda2cf | ||
![]() |
5f64a7a625 | ||
![]() |
ffd28de388 | ||
![]() |
af589dd5e9 | ||
![]() |
fd60aeb55b | ||
![]() |
79a3f364dd | ||
![]() |
33d699a4e7 | ||
![]() |
f166a02b67 | ||
![]() |
c5948b472b | ||
![]() |
7ee5e97c46 | ||
![]() |
7ef2dbd239 | ||
![]() |
524d0d2cfc | ||
![]() |
91f04e7410 | ||
![]() |
9f7baf139f | ||
![]() |
ec89046fa1 | ||
![]() |
cc0dd86580 | ||
![]() |
0baa0a5a02 | ||
![]() |
039f6921c2 | ||
![]() |
7fa6db2545 | ||
![]() |
840931e766 | ||
![]() |
1ce3f736d2 | ||
![]() |
4d0090f90a | ||
![]() |
f8d5f3dff5 | ||
![]() |
298e03d102 | ||
![]() |
54f3902393 | ||
![]() |
3ca6253beb | ||
![]() |
84df0dc40b | ||
![]() |
a857811c75 | ||
![]() |
3d6219b6db | ||
![]() |
0a53c7016f | ||
![]() |
f0dc5c0419 | ||
![]() |
df8c36265a | ||
![]() |
c351d8781d | ||
![]() |
d553a522b9 | ||
![]() |
0b6d5f27c8 | ||
![]() |
9ecfd7daa3 | ||
![]() |
90f1aa38b6 | ||
![]() |
fc5c81ce0a | ||
![]() |
e820e3a259 | ||
![]() |
17911d0a96 | ||
![]() |
2ed7f5a670 | ||
![]() |
7c6c5767eb | ||
![]() |
0ec869527c | ||
![]() |
0b198e38c5 | ||
![]() |
1ea3248290 | ||
![]() |
bdd2db60c2 |
@@ -1,7 +1,7 @@
|
|||||||
Entries are sorted chronologically from oldest to youngest within each release,
|
Entries are sorted chronologically from oldest to youngest within each release,
|
||||||
releases are sorted from youngest to oldest.
|
releases are sorted from youngest to oldest.
|
||||||
|
|
||||||
version <next>:
|
version 1.2:
|
||||||
|
|
||||||
- VDPAU hardware acceleration through normal hwaccel
|
- VDPAU hardware acceleration through normal hwaccel
|
||||||
- SRTP support
|
- SRTP support
|
||||||
|
@@ -445,9 +445,9 @@ x86 Michael Niedermayer
|
|||||||
Releases
|
Releases
|
||||||
========
|
========
|
||||||
|
|
||||||
|
1.2 Michael Niedermayer
|
||||||
1.1 Michael Niedermayer
|
1.1 Michael Niedermayer
|
||||||
1.0 Michael Niedermayer
|
1.0 Michael Niedermayer
|
||||||
0.11 Michael Niedermayer
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@@ -190,13 +190,13 @@ void show_help_options(const OptionDef *options, const char *msg, int req_flags,
|
|||||||
void show_help_children(const AVClass *class, int flags);
|
void show_help_children(const AVClass *class, int flags);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Per-avtool specific help handler. Implemented in each
|
* Per-fftool specific help handler. Implemented in each
|
||||||
* avtool, called by show_help().
|
* fftool, called by show_help().
|
||||||
*/
|
*/
|
||||||
void show_help_default(const char *opt, const char *arg);
|
void show_help_default(const char *opt, const char *arg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generic -h handler common to all avtools.
|
* Generic -h handler common to all fftools.
|
||||||
*/
|
*/
|
||||||
int show_help(void *optctx, const char *opt, const char *arg);
|
int show_help(void *optctx, const char *opt, const char *arg);
|
||||||
|
|
||||||
|
27
configure
vendored
27
configure
vendored
@@ -140,10 +140,10 @@ Component options:
|
|||||||
--disable-fft disable FFT code
|
--disable-fft disable FFT code
|
||||||
|
|
||||||
Hardware accelerators:
|
Hardware accelerators:
|
||||||
--enable-dxva2 enable DXVA2 code
|
--disable-dxva2 disable DXVA2 code [autodetect]
|
||||||
--enable-vaapi enable VAAPI code
|
--disable-vaapi disable VAAPI code [autodetect]
|
||||||
--enable-vda enable VDA code
|
--enable-vda enable VDA code
|
||||||
--enable-vdpau enable VDPAU code
|
--disable-vdpau disable VDPAU code [autodetect]
|
||||||
|
|
||||||
Individual component options:
|
Individual component options:
|
||||||
--disable-everything disable all components listed below
|
--disable-everything disable all components listed below
|
||||||
@@ -184,11 +184,11 @@ Individual component options:
|
|||||||
|
|
||||||
External library support:
|
External library support:
|
||||||
--enable-avisynth enable reading of AVISynth script files [no]
|
--enable-avisynth enable reading of AVISynth script files [no]
|
||||||
--enable-bzlib enable bzlib [autodetect]
|
--disable-bzlib disable bzlib [autodetect]
|
||||||
--enable-fontconfig enable fontconfig
|
--enable-fontconfig enable fontconfig
|
||||||
--enable-frei0r enable frei0r video filtering
|
--enable-frei0r enable frei0r video filtering
|
||||||
--enable-gnutls enable gnutls [no]
|
--enable-gnutls enable gnutls [no]
|
||||||
--enable-iconv enable iconv [no]
|
--disable-iconv disable iconv [autodetect]
|
||||||
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
|
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
|
||||||
--enable-libass enable libass subtitles rendering [no]
|
--enable-libass enable libass subtitles rendering [no]
|
||||||
--enable-libbluray enable BluRay reading using libbluray [no]
|
--enable-libbluray enable BluRay reading using libbluray [no]
|
||||||
@@ -235,7 +235,7 @@ External library support:
|
|||||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||||
--enable-openssl enable openssl [no]
|
--enable-openssl enable openssl [no]
|
||||||
--enable-x11grab enable X11 grabbing [no]
|
--enable-x11grab enable X11 grabbing [no]
|
||||||
--enable-zlib enable zlib [autodetect]
|
--disable-zlib disable zlib [autodetect]
|
||||||
|
|
||||||
Advanced options (experts only):
|
Advanced options (experts only):
|
||||||
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
|
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
|
||||||
@@ -2169,6 +2169,9 @@ enable safe_bitstream_reader
|
|||||||
enable static
|
enable static
|
||||||
enable swscale_alpha
|
enable swscale_alpha
|
||||||
|
|
||||||
|
# Enable hwaccels by default.
|
||||||
|
enable dxva2 vaapi vdpau
|
||||||
|
|
||||||
# build settings
|
# build settings
|
||||||
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
||||||
FFSERVERLDFLAGS=-Wl,-E
|
FFSERVERLDFLAGS=-Wl,-E
|
||||||
@@ -3873,7 +3876,6 @@ fi
|
|||||||
|
|
||||||
check_lib math.h sin -lm && LIBM="-lm"
|
check_lib math.h sin -lm && LIBM="-lm"
|
||||||
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
|
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
|
||||||
enabled vaapi && require vaapi va/va.h vaInitialize -lva
|
|
||||||
|
|
||||||
atan2f_args=2
|
atan2f_args=2
|
||||||
ldexpf_args=2
|
ldexpf_args=2
|
||||||
@@ -4041,19 +4043,16 @@ require X11 X11/Xlib.h XOpenDisplay -lX11 &&
|
|||||||
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
|
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
|
||||||
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
|
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
|
||||||
|
|
||||||
if ! disabled vaapi; then
|
enabled vaapi &&
|
||||||
check_lib va/va.h vaInitialize -lva && {
|
check_lib va/va.h vaInitialize -lva ||
|
||||||
check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
|
disable vaapi
|
||||||
warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
|
|
||||||
} || disable vaapi
|
|
||||||
fi
|
|
||||||
|
|
||||||
enabled vdpau &&
|
enabled vdpau &&
|
||||||
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
|
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
|
||||||
disable vdpau
|
disable vdpau
|
||||||
|
|
||||||
# Funny iconv installations are not unusual, so check it after all flags have been set
|
# Funny iconv installations are not unusual, so check it after all flags have been set
|
||||||
enabled iconv && { check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || die "ERROR: iconv not found"; }
|
disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
|
||||||
|
|
||||||
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
|
enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
|
||||||
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
|
enabled coverage && add_cflags "-fprofile-arcs -ftest-coverage" && add_ldflags "-fprofile-arcs -ftest-coverage"
|
||||||
|
@@ -31,7 +31,7 @@ PROJECT_NAME = FFmpeg
|
|||||||
# This could be handy for archiving the generated documentation or
|
# This could be handy for archiving the generated documentation or
|
||||||
# if some version control system is used.
|
# if some version control system is used.
|
||||||
|
|
||||||
PROJECT_NUMBER =
|
PROJECT_NUMBER = 1.2.2
|
||||||
|
|
||||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||||
# in the documentation. The maximum height of the logo should not exceed 55
|
# in the documentation. The maximum height of the logo should not exceed 55
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
Release Notes
|
Release Notes
|
||||||
=============
|
=============
|
||||||
|
|
||||||
* 0.10 "Freedom" January, 2012
|
* 1.2 "Magic" March, 2013
|
||||||
|
|
||||||
|
|
||||||
General notes
|
General notes
|
||||||
@@ -14,9 +14,3 @@ accepted. If you are experiencing issues with any formally released version of
|
|||||||
FFmpeg, please try git master to check if the issue still exists. If it does,
|
FFmpeg, please try git master to check if the issue still exists. If it does,
|
||||||
make your report against the development code following the usual bug reporting
|
make your report against the development code following the usual bug reporting
|
||||||
guidelines.
|
guidelines.
|
||||||
|
|
||||||
Of big interest to our Windows users, FFmpeg now supports building with the MSVC
|
|
||||||
compiler. Since MSVC does not support C99 features used extensively by FFmpeg,
|
|
||||||
this has been accomplished using a converter that turns C99 code to C89. See the
|
|
||||||
platform-specific documentation for more detailed documentation on building
|
|
||||||
FFmpeg with MSVC.
|
|
||||||
|
@@ -24,7 +24,7 @@ a mail for every change to every issue.
|
|||||||
The subscription URL for the ffmpeg-trac list is:
|
The subscription URL for the ffmpeg-trac list is:
|
||||||
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||||
The URL of the webinterface of the tracker is:
|
The URL of the webinterface of the tracker is:
|
||||||
http(s)://ffmpeg.org/trac/ffmpeg
|
http(s)://trac.ffmpeg.org
|
||||||
|
|
||||||
Type:
|
Type:
|
||||||
-----
|
-----
|
||||||
|
5
ffmpeg.c
5
ffmpeg.c
@@ -162,6 +162,8 @@ static struct termios oldtty;
|
|||||||
static int restore_tty;
|
static int restore_tty;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static void free_input_threads(void);
|
||||||
|
|
||||||
|
|
||||||
/* sub2video hack:
|
/* sub2video hack:
|
||||||
Convert subtitles to video with alpha to insert them in filter graphs.
|
Convert subtitles to video with alpha to insert them in filter graphs.
|
||||||
@@ -457,6 +459,9 @@ static void exit_program(void)
|
|||||||
av_freep(&output_streams[i]->logfile_prefix);
|
av_freep(&output_streams[i]->logfile_prefix);
|
||||||
av_freep(&output_streams[i]);
|
av_freep(&output_streams[i]);
|
||||||
}
|
}
|
||||||
|
#if HAVE_PTHREADS
|
||||||
|
free_input_threads();
|
||||||
|
#endif
|
||||||
for (i = 0; i < nb_input_files; i++) {
|
for (i = 0; i < nb_input_files; i++) {
|
||||||
avformat_close_input(&input_files[i]->ctx);
|
avformat_close_input(&input_files[i]->ctx);
|
||||||
av_freep(&input_files[i]);
|
av_freep(&input_files[i]);
|
||||||
|
@@ -710,7 +710,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
|||||||
const float lambda)
|
const float lambda)
|
||||||
{
|
{
|
||||||
int start = 0, i, w, w2, g;
|
int start = 0, i, w, w2, g;
|
||||||
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
|
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
|
||||||
float dists[128] = { 0 }, uplims[128];
|
float dists[128] = { 0 }, uplims[128];
|
||||||
float maxvals[128];
|
float maxvals[128];
|
||||||
int fflag, minscaler;
|
int fflag, minscaler;
|
||||||
|
@@ -274,7 +274,7 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
|
|||||||
// generate warm-up samples
|
// generate warm-up samples
|
||||||
residual[0] = samples[0];
|
residual[0] = samples[0];
|
||||||
for (i = 1; i <= lpc.lpc_order; i++)
|
for (i = 1; i <= lpc.lpc_order; i++)
|
||||||
residual[i] = samples[i] - samples[i-1];
|
residual[i] = sign_extend(samples[i] - samples[i-1], s->write_sample_size);
|
||||||
|
|
||||||
// perform lpc on remaining samples
|
// perform lpc on remaining samples
|
||||||
for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
|
for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
|
||||||
|
@@ -661,8 +661,8 @@ static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb,
|
|||||||
|
|
||||||
snd->num_components = decode_tonal_components(gb, snd->components,
|
snd->num_components = decode_tonal_components(gb, snd->components,
|
||||||
snd->bands_coded);
|
snd->bands_coded);
|
||||||
if (snd->num_components == -1)
|
if (snd->num_components < 0)
|
||||||
return -1;
|
return snd->num_components;
|
||||||
|
|
||||||
num_subbands = decode_spectrum(gb, snd->spectrum);
|
num_subbands = decode_spectrum(gb, snd->spectrum);
|
||||||
|
|
||||||
|
@@ -300,6 +300,8 @@ static int cdg_decode_frame(AVCodecContext *avctx,
|
|||||||
inst = bytestream_get_byte(&buf);
|
inst = bytestream_get_byte(&buf);
|
||||||
inst &= CDG_MASK;
|
inst &= CDG_MASK;
|
||||||
buf += 2; /// skipping 2 unneeded bytes
|
buf += 2; /// skipping 2 unneeded bytes
|
||||||
|
|
||||||
|
if (buf_size > CDG_HEADER_SIZE)
|
||||||
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
|
bytestream_get_buffer(&buf, cdg_data, buf_size - CDG_HEADER_SIZE);
|
||||||
|
|
||||||
if ((command & CDG_MASK) == CDG_COMMAND) {
|
if ((command & CDG_MASK) == CDG_COMMAND) {
|
||||||
|
@@ -212,6 +212,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
|||||||
buf[803] = s->bits_per_component;
|
buf[803] = s->bits_per_component;
|
||||||
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
|
write16(buf + 804, (s->bits_per_component == 10 || s->bits_per_component == 12) ?
|
||||||
1 : 0); /* packing method */
|
1 : 0); /* packing method */
|
||||||
|
write32(buf + 808, HEADER_SIZE); /* data offset */
|
||||||
|
|
||||||
/* Image source information header */
|
/* Image source information header */
|
||||||
write32(buf + 1628, avctx->sample_aspect_ratio.num);
|
write32(buf + 1628, avctx->sample_aspect_ratio.num);
|
||||||
|
@@ -348,7 +348,8 @@ static int decode_block(AVCodecContext *avctx, void *tdata,
|
|||||||
const uint8_t *src;
|
const uint8_t *src;
|
||||||
int axmax = (avctx->width - (s->xmax + 1)) * 2 * s->desc->nb_components;
|
int axmax = (avctx->width - (s->xmax + 1)) * 2 * s->desc->nb_components;
|
||||||
int bxmin = s->xmin * 2 * s->desc->nb_components;
|
int bxmin = s->xmin * 2 * s->desc->nb_components;
|
||||||
int ret, i, x, buf_size = s->buf_size;
|
int i, x, buf_size = s->buf_size;
|
||||||
|
int av_unused ret;
|
||||||
|
|
||||||
line_offset = AV_RL64(s->table + jobnr * 8);
|
line_offset = AV_RL64(s->table + jobnr * 8);
|
||||||
// Check if the buffer has the required bytes needed from the offset
|
// Check if the buffer has the required bytes needed from the offset
|
||||||
|
@@ -27,7 +27,7 @@ const int ff_flac_sample_rate_table[16] =
|
|||||||
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
|
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
|
||||||
0, 0, 0, 0 };
|
0, 0, 0, 0 };
|
||||||
|
|
||||||
const int16_t ff_flac_blocksize_table[16] = {
|
const int32_t ff_flac_blocksize_table[16] = {
|
||||||
0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
|
0, 192, 576<<0, 576<<1, 576<<2, 576<<3, 0, 0,
|
||||||
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
|
256<<0, 256<<1, 256<<2, 256<<3, 256<<4, 256<<5, 256<<6, 256<<7
|
||||||
};
|
};
|
||||||
|
@@ -26,6 +26,6 @@
|
|||||||
|
|
||||||
extern const int ff_flac_sample_rate_table[16];
|
extern const int ff_flac_sample_rate_table[16];
|
||||||
|
|
||||||
extern const int16_t ff_flac_blocksize_table[16];
|
extern const int32_t ff_flac_blocksize_table[16];
|
||||||
|
|
||||||
#endif /* AVCODEC_FLACDATA_H */
|
#endif /* AVCODEC_FLACDATA_H */
|
||||||
|
@@ -462,6 +462,7 @@ static int gif_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, A
|
|||||||
|
|
||||||
if (s->keyframe) {
|
if (s->keyframe) {
|
||||||
s->keyframe_ok = 0;
|
s->keyframe_ok = 0;
|
||||||
|
s->gce_prev_disposal = GCE_DISPOSAL_NONE;
|
||||||
if ((ret = gif_read_header1(s)) < 0)
|
if ((ret = gif_read_header1(s)) < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
@@ -706,7 +706,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
|
|||||||
down the code */
|
down the code */
|
||||||
if(h->slice_type_nos != AV_PICTURE_TYPE_I){
|
if(h->slice_type_nos != AV_PICTURE_TYPE_I){
|
||||||
if(h->mb_skip_run==-1)
|
if(h->mb_skip_run==-1)
|
||||||
h->mb_skip_run= get_ue_golomb(&h->gb);
|
h->mb_skip_run= get_ue_golomb_long(&h->gb);
|
||||||
|
|
||||||
if (h->mb_skip_run--) {
|
if (h->mb_skip_run--) {
|
||||||
if(FRAME_MBAFF && (h->mb_y&1) == 0){
|
if(FRAME_MBAFF && (h->mb_y&1) == 0){
|
||||||
|
@@ -31,9 +31,11 @@
|
|||||||
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_ ## depth ## _c; \
|
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_ ## depth ## _c; \
|
||||||
c->put_h264_chroma_pixels_tab[1] = put_h264_chroma_mc4_ ## depth ## _c; \
|
c->put_h264_chroma_pixels_tab[1] = put_h264_chroma_mc4_ ## depth ## _c; \
|
||||||
c->put_h264_chroma_pixels_tab[2] = put_h264_chroma_mc2_ ## depth ## _c; \
|
c->put_h264_chroma_pixels_tab[2] = put_h264_chroma_mc2_ ## depth ## _c; \
|
||||||
|
c->put_h264_chroma_pixels_tab[3] = put_h264_chroma_mc1_ ## depth ## _c; \
|
||||||
c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_ ## depth ## _c; \
|
c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_ ## depth ## _c; \
|
||||||
c->avg_h264_chroma_pixels_tab[1] = avg_h264_chroma_mc4_ ## depth ## _c; \
|
c->avg_h264_chroma_pixels_tab[1] = avg_h264_chroma_mc4_ ## depth ## _c; \
|
||||||
c->avg_h264_chroma_pixels_tab[2] = avg_h264_chroma_mc2_ ## depth ## _c; \
|
c->avg_h264_chroma_pixels_tab[2] = avg_h264_chroma_mc2_ ## depth ## _c; \
|
||||||
|
c->avg_h264_chroma_pixels_tab[3] = avg_h264_chroma_mc1_ ## depth ## _c; \
|
||||||
|
|
||||||
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
|
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
|
||||||
{
|
{
|
||||||
|
@@ -24,8 +24,8 @@
|
|||||||
typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
|
typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
|
||||||
|
|
||||||
typedef struct H264ChromaContext {
|
typedef struct H264ChromaContext {
|
||||||
h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
|
h264_chroma_mc_func put_h264_chroma_pixels_tab[4];
|
||||||
h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
|
h264_chroma_mc_func avg_h264_chroma_pixels_tab[4];
|
||||||
} H264ChromaContext;
|
} H264ChromaContext;
|
||||||
|
|
||||||
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth);
|
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth);
|
||||||
|
@@ -24,6 +24,34 @@
|
|||||||
#include "bit_depth_template.c"
|
#include "bit_depth_template.c"
|
||||||
|
|
||||||
#define H264_CHROMA_MC(OPNAME, OP)\
|
#define H264_CHROMA_MC(OPNAME, OP)\
|
||||||
|
static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
|
||||||
|
pixel *dst = (pixel*)_dst;\
|
||||||
|
pixel *src = (pixel*)_src;\
|
||||||
|
const int A=(8-x)*(8-y);\
|
||||||
|
const int B=( x)*(8-y);\
|
||||||
|
const int C=(8-x)*( y);\
|
||||||
|
const int D=( x)*( y);\
|
||||||
|
int i;\
|
||||||
|
stride >>= sizeof(pixel)-1;\
|
||||||
|
\
|
||||||
|
av_assert2(x<8 && y<8 && x>=0 && y>=0);\
|
||||||
|
\
|
||||||
|
if(D){\
|
||||||
|
for(i=0; i<h; i++){\
|
||||||
|
OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
|
||||||
|
dst+= stride;\
|
||||||
|
src+= stride;\
|
||||||
|
}\
|
||||||
|
}else{\
|
||||||
|
const int E= B+C;\
|
||||||
|
const int step= C ? stride : 1;\
|
||||||
|
for(i=0; i<h; i++){\
|
||||||
|
OP(dst[0], (A*src[0] + E*src[step+0]));\
|
||||||
|
dst+= stride;\
|
||||||
|
src+= stride;\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
|
}\
|
||||||
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
|
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
|
||||||
pixel *dst = (pixel*)_dst;\
|
pixel *dst = (pixel*)_dst;\
|
||||||
pixel *src = (pixel*)_src;\
|
pixel *src = (pixel*)_src;\
|
||||||
|
@@ -804,8 +804,16 @@ static int decode_band(IVI45DecContext *ctx,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
|
result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
|
||||||
if (result < 0 || ((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
if (result < 0) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Corrupted tile data encountered!\n");
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Corrupted tile data encountered!\n");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR,
|
||||||
|
"Tile data_size mismatch!\n");
|
||||||
|
result = AVERROR_INVALIDDATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -175,7 +175,7 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
|||||||
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
frame->pict_type == AV_PICTURE_TYPE_P ? X264_TYPE_P :
|
||||||
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
frame->pict_type == AV_PICTURE_TYPE_B ? X264_TYPE_B :
|
||||||
X264_TYPE_AUTO;
|
X264_TYPE_AUTO;
|
||||||
if (x4->params.b_tff != frame->top_field_first) {
|
if (x4->params.b_interlaced && x4->params.b_tff != frame->top_field_first) {
|
||||||
x4->params.b_tff = frame->top_field_first;
|
x4->params.b_tff = frame->top_field_first;
|
||||||
x264_encoder_reconfig(x4->enc, &x4->params);
|
x264_encoder_reconfig(x4->enc, &x4->params);
|
||||||
}
|
}
|
||||||
|
@@ -747,7 +747,9 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
|
|||||||
|
|
||||||
i = 8 + ((-get_bits_count(&s->gb)) & 7);
|
i = 8 + ((-get_bits_count(&s->gb)) & 7);
|
||||||
/* skip RSTn */
|
/* skip RSTn */
|
||||||
if (s->restart_count == 0 && show_bits(&s->gb, i) == (1 << i) - 1) {
|
if (s->restart_count == 0) {
|
||||||
|
if( show_bits(&s->gb, i) == (1 << i) - 1
|
||||||
|
|| show_bits(&s->gb, i) == 0xFF) {
|
||||||
int pos = get_bits_count(&s->gb);
|
int pos = get_bits_count(&s->gb);
|
||||||
align_get_bits(&s->gb);
|
align_get_bits(&s->gb);
|
||||||
while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
|
while (get_bits_left(&s->gb) >= 8 && show_bits(&s->gb, 8) == 0xFF)
|
||||||
@@ -759,6 +761,7 @@ static void handle_rstn(MJpegDecodeContext *s, int nb_components)
|
|||||||
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
skip_bits_long(&s->gb, pos - get_bits_count(&s->gb));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform)
|
static int ljpeg_decode_rgb_scan(MJpegDecodeContext *s, int nb_components, int predictor, int point_transform)
|
||||||
@@ -1636,6 +1639,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
|||||||
MJpegDecodeContext *s = avctx->priv_data;
|
MJpegDecodeContext *s = avctx->priv_data;
|
||||||
const uint8_t *buf_end, *buf_ptr;
|
const uint8_t *buf_end, *buf_ptr;
|
||||||
const uint8_t *unescaped_buf_ptr;
|
const uint8_t *unescaped_buf_ptr;
|
||||||
|
int hshift, vshift;
|
||||||
int unescaped_buf_size;
|
int unescaped_buf_size;
|
||||||
int start_code;
|
int start_code;
|
||||||
int i, index;
|
int i, index;
|
||||||
@@ -1814,6 +1818,9 @@ the_end:
|
|||||||
}
|
}
|
||||||
if (s->upscale_v) {
|
if (s->upscale_v) {
|
||||||
uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]];
|
uint8_t *dst = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(s->height - 1) * s->linesize[s->upscale_v]];
|
||||||
|
int w;
|
||||||
|
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||||
|
w = s->width >> hshift;
|
||||||
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
|
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUV444P ||
|
||||||
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
|
avctx->pix_fmt == AV_PIX_FMT_YUVJ422P ||
|
||||||
@@ -1822,16 +1829,16 @@ the_end:
|
|||||||
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]];
|
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[i / 2 * s->linesize[s->upscale_v]];
|
||||||
uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]];
|
uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[s->upscale_v])[(i + 1) / 2 * s->linesize[s->upscale_v]];
|
||||||
if (src1 == src2) {
|
if (src1 == src2) {
|
||||||
memcpy(dst, src1, s->width);
|
memcpy(dst, src1, w);
|
||||||
} else {
|
} else {
|
||||||
for (index = 0; index < s->width; index++)
|
for (index = 0; index < w; index++)
|
||||||
dst[index] = (src1[index] + src2[index]) >> 1;
|
dst[index] = (src1[index] + src2[index]) >> 1;
|
||||||
}
|
}
|
||||||
dst -= s->linesize[s->upscale_v];
|
dst -= s->linesize[s->upscale_v];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
|
if (s->flipped && (s->avctx->flags & CODEC_FLAG_EMU_EDGE)) {
|
||||||
int hshift, vshift, j;
|
int j;
|
||||||
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||||
for (index=0; index<4; index++) {
|
for (index=0; index<4; index++) {
|
||||||
uint8_t *dst = s->picture_ptr->data[index];
|
uint8_t *dst = s->picture_ptr->data[index];
|
||||||
|
@@ -104,6 +104,9 @@ static int mm_decode_intra(MmContext * s, int half_horiz, int half_vert)
|
|||||||
if (half_horiz)
|
if (half_horiz)
|
||||||
run_length *=2;
|
run_length *=2;
|
||||||
|
|
||||||
|
if (run_length > s->avctx->width - x)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
|
||||||
if (color) {
|
if (color) {
|
||||||
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
|
memset(s->frame.data[0] + y*s->frame.linesize[0] + x, color, run_length);
|
||||||
if (half_vert)
|
if (half_vert)
|
||||||
@@ -151,6 +154,8 @@ static int mm_decode_inter(MmContext * s, int half_horiz, int half_vert)
|
|||||||
int replace_array = bytestream2_get_byte(&s->gb);
|
int replace_array = bytestream2_get_byte(&s->gb);
|
||||||
for(j=0; j<8; j++) {
|
for(j=0; j<8; j++) {
|
||||||
int replace = (replace_array >> (7-j)) & 1;
|
int replace = (replace_array >> (7-j)) & 1;
|
||||||
|
if (x + half_horiz >= s->avctx->width)
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
if (replace) {
|
if (replace) {
|
||||||
int color = bytestream2_get_byte(&data_ptr);
|
int color = bytestream2_get_byte(&data_ptr);
|
||||||
s->frame.data[0][y*s->frame.linesize[0] + x] = color;
|
s->frame.data[0][y*s->frame.linesize[0] + x] = color;
|
||||||
|
@@ -1266,7 +1266,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
|
|||||||
s1->save_width != s->width ||
|
s1->save_width != s->width ||
|
||||||
s1->save_height != s->height ||
|
s1->save_height != s->height ||
|
||||||
s1->save_aspect_info != s->aspect_ratio_info ||
|
s1->save_aspect_info != s->aspect_ratio_info ||
|
||||||
s1->save_progressive_seq != s->progressive_sequence ||
|
(s1->save_progressive_seq != s->progressive_sequence && (s->height&31)) ||
|
||||||
0)
|
0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -2277,7 +2277,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code);
|
buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code);
|
||||||
if (start_code > 0x1ff) {
|
if (start_code > 0x1ff) {
|
||||||
if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) {
|
if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) {
|
||||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
|
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||||
|
!avctx->hwaccel) {
|
||||||
int i;
|
int i;
|
||||||
av_assert0(avctx->thread_count > 1);
|
av_assert0(avctx->thread_count > 1);
|
||||||
|
|
||||||
@@ -2337,7 +2338,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
s2->intra_dc_precision= 3;
|
s2->intra_dc_precision= 3;
|
||||||
s2->intra_matrix[0]= 1;
|
s2->intra_matrix[0]= 1;
|
||||||
}
|
}
|
||||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && s->slice_count) {
|
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||||
|
!avctx->hwaccel && s->slice_count) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
avctx->execute(avctx, slice_decode_thread,
|
avctx->execute(avctx, slice_decode_thread,
|
||||||
@@ -2504,7 +2506,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
|
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||||
|
!avctx->hwaccel) {
|
||||||
int threshold = (s2->mb_height * s->slice_count +
|
int threshold = (s2->mb_height * s->slice_count +
|
||||||
s2->slice_context_count / 2) /
|
s2->slice_context_count / 2) /
|
||||||
s2->slice_context_count;
|
s2->slice_context_count;
|
||||||
|
@@ -2102,7 +2102,7 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
|
|||||||
int motion_x, int motion_y)
|
int motion_x, int motion_y)
|
||||||
{
|
{
|
||||||
const int lowres = s->avctx->lowres;
|
const int lowres = s->avctx->lowres;
|
||||||
const int op_index = FFMIN(lowres, 2);
|
const int op_index = FFMIN(lowres, 3);
|
||||||
const int s_mask = (2 << lowres) - 1;
|
const int s_mask = (2 << lowres) - 1;
|
||||||
int emu = 0;
|
int emu = 0;
|
||||||
int sx, sy;
|
int sx, sy;
|
||||||
@@ -2155,7 +2155,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
|||||||
int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy,
|
int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy,
|
||||||
uvsx, uvsy;
|
uvsx, uvsy;
|
||||||
const int lowres = s->avctx->lowres;
|
const int lowres = s->avctx->lowres;
|
||||||
const int op_index = FFMIN(lowres-1+s->chroma_x_shift, 2);
|
const int op_index = FFMIN(lowres-1+s->chroma_x_shift, 3);
|
||||||
const int block_s = 8>>lowres;
|
const int block_s = 8>>lowres;
|
||||||
const int s_mask = (2 << lowres) - 1;
|
const int s_mask = (2 << lowres) - 1;
|
||||||
const int h_edge_pos = s->h_edge_pos >> lowres;
|
const int h_edge_pos = s->h_edge_pos >> lowres;
|
||||||
@@ -2221,7 +2221,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
|||||||
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
|
ptr_cb = ref_picture[1] + uvsrc_y * uvlinesize + uvsrc_x;
|
||||||
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
|
ptr_cr = ref_picture[2] + uvsrc_y * uvlinesize + uvsrc_x;
|
||||||
|
|
||||||
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) ||
|
if ((unsigned) src_x > FFMAX( h_edge_pos - (!!sx) - 2 * block_s, 0) || uvsrc_y<0 ||
|
||||||
(unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
|
(unsigned) src_y > FFMAX((v_edge_pos >> field_based) - (!!sy) - h, 0)) {
|
||||||
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
|
s->vdsp.emulated_edge_mc(s->edge_emu_buffer, ptr_y,
|
||||||
linesize >> field_based, 17, 17 + field_based,
|
linesize >> field_based, 17, 17 + field_based,
|
||||||
@@ -2261,11 +2261,12 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
|||||||
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
|
pix_op[lowres - 1](dest_y, ptr_y, linesize, h, sx, sy);
|
||||||
|
|
||||||
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
|
if (!CONFIG_GRAY || !(s->flags & CODEC_FLAG_GRAY)) {
|
||||||
|
int hc = s->chroma_y_shift ? (h+1-bottom_field)>>1 : h;
|
||||||
uvsx = (uvsx << 2) >> lowres;
|
uvsx = (uvsx << 2) >> lowres;
|
||||||
uvsy = (uvsy << 2) >> lowres;
|
uvsy = (uvsy << 2) >> lowres;
|
||||||
if (h >> s->chroma_y_shift) {
|
if (hc) {
|
||||||
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
|
pix_op[op_index](dest_cb, ptr_cb, uvlinesize, hc, uvsx, uvsy);
|
||||||
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, h >> s->chroma_y_shift, uvsx, uvsy);
|
pix_op[op_index](dest_cr, ptr_cr, uvlinesize, hc, uvsx, uvsy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// FIXME h261 lowres loop filter
|
// FIXME h261 lowres loop filter
|
||||||
@@ -2278,7 +2279,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
|
|||||||
int mx, int my)
|
int mx, int my)
|
||||||
{
|
{
|
||||||
const int lowres = s->avctx->lowres;
|
const int lowres = s->avctx->lowres;
|
||||||
const int op_index = FFMIN(lowres, 2);
|
const int op_index = FFMIN(lowres, 3);
|
||||||
const int block_s = 8 >> lowres;
|
const int block_s = 8 >> lowres;
|
||||||
const int s_mask = (2 << lowres) - 1;
|
const int s_mask = (2 << lowres) - 1;
|
||||||
const int h_edge_pos = s->h_edge_pos >> lowres + 1;
|
const int h_edge_pos = s->h_edge_pos >> lowres + 1;
|
||||||
|
@@ -767,7 +767,8 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
|
|||||||
int type34_first;
|
int type34_first;
|
||||||
float type34_div = 0;
|
float type34_div = 0;
|
||||||
float type34_predictor;
|
float type34_predictor;
|
||||||
float samples[10], sign_bits[16];
|
float samples[10];
|
||||||
|
int sign_bits[16] = {0};
|
||||||
|
|
||||||
if (length == 0) {
|
if (length == 0) {
|
||||||
// If no data use noise
|
// If no data use noise
|
||||||
|
@@ -67,7 +67,7 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
|
|||||||
* line' at the beginning. Since we always interpret it as 'go to next line'
|
* line' at the beginning. Since we always interpret it as 'go to next line'
|
||||||
* in the decoding loop (which makes code simpler/faster), the first line
|
* in the decoding loop (which makes code simpler/faster), the first line
|
||||||
* would not be counted, so we count one more.
|
* would not be counted, so we count one more.
|
||||||
* See: https://ffmpeg.org/trac/ffmpeg/ticket/226
|
* See: https://trac.ffmpeg.org/ticket/226
|
||||||
* In the following decoding loop, row_ptr will be the position of the
|
* In the following decoding loop, row_ptr will be the position of the
|
||||||
* current row. */
|
* current row. */
|
||||||
|
|
||||||
|
@@ -739,6 +739,11 @@ static int process_frame_obj(SANMVideoContext *ctx)
|
|||||||
w = bytestream2_get_le16u(&ctx->gb);
|
w = bytestream2_get_le16u(&ctx->gb);
|
||||||
h = bytestream2_get_le16u(&ctx->gb);
|
h = bytestream2_get_le16u(&ctx->gb);
|
||||||
|
|
||||||
|
if (!w || !h) {
|
||||||
|
av_log(ctx->avctx, AV_LOG_ERROR, "dimensions are invalid\n");
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
|
|
||||||
if (ctx->width < left + w || ctx->height < top + h) {
|
if (ctx->width < left + w || ctx->height < top + h) {
|
||||||
if (av_image_check_size(FFMAX(left + w, ctx->width),
|
if (av_image_check_size(FFMAX(left + w, ctx->width),
|
||||||
FFMAX(top + h, ctx->height), 0, ctx->avctx) < 0)
|
FFMAX(top + h, ctx->height), 0, ctx->avctx) < 0)
|
||||||
|
@@ -694,7 +694,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
val |= h[3].values[res] << 8;
|
val |= h[3].values[res] << 8;
|
||||||
pred[1] += sign_extend(val, 16);
|
pred[1] += sign_extend(val, 16);
|
||||||
*samples++ = av_clip_int16(pred[1]);
|
*samples++ = pred[1];
|
||||||
} else {
|
} else {
|
||||||
if(vlc[0].table)
|
if(vlc[0].table)
|
||||||
res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
|
res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
|
||||||
@@ -715,7 +715,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
}
|
}
|
||||||
val |= h[1].values[res] << 8;
|
val |= h[1].values[res] << 8;
|
||||||
pred[0] += sign_extend(val, 16);
|
pred[0] += sign_extend(val, 16);
|
||||||
*samples++ = av_clip_int16(pred[0]);
|
*samples++ = pred[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { //8-bit data
|
} else { //8-bit data
|
||||||
|
@@ -474,7 +474,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
|
|||||||
|
|
||||||
buf->linesize[i] = picture.linesize[i];
|
buf->linesize[i] = picture.linesize[i];
|
||||||
|
|
||||||
buf->base[i] = av_malloc(size[i] + 16); //FIXME 16
|
buf->base[i] = av_malloc(size[i] + 16 + STRIDE_ALIGN - 1); //FIXME 16
|
||||||
if (buf->base[i] == NULL)
|
if (buf->base[i] == NULL)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
@@ -1938,7 +1938,7 @@ static int recode_subtitle(AVCodecContext *avctx,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
outpkt->size -= outl;
|
outpkt->size -= outl;
|
||||||
outpkt->data[outpkt->size - 1] = '\0';
|
memset(outpkt->data + outpkt->size, 0, outl);
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if (cd != (iconv_t)-1)
|
if (cd != (iconv_t)-1)
|
||||||
|
@@ -46,6 +46,9 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
|
|||||||
VABufferID va_buffers[3];
|
VABufferID va_buffers[3];
|
||||||
unsigned int n_va_buffers = 0;
|
unsigned int n_va_buffers = 0;
|
||||||
|
|
||||||
|
if (!vactx->pic_param_buf_id)
|
||||||
|
return 0;
|
||||||
|
|
||||||
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
|
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
|
||||||
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
|
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
|
||||||
|
|
||||||
@@ -212,7 +215,7 @@ int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
|
|||||||
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
|
ff_mpeg_draw_horiz_band(s, 0, s->avctx->height);
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
ff_vaapi_common_end_frame(avctx->priv_data);
|
ff_vaapi_common_end_frame(avctx);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -162,7 +162,7 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
|
|||||||
const unsigned char *ps;
|
const unsigned char *ps;
|
||||||
const unsigned char *ps_end;
|
const unsigned char *ps_end;
|
||||||
unsigned char *pd;
|
unsigned char *pd;
|
||||||
int i, l;
|
int i, j, l;
|
||||||
unsigned char *dest_end = dest + dest_len;
|
unsigned char *dest_end = dest + dest_len;
|
||||||
|
|
||||||
ps = src;
|
ps = src;
|
||||||
@@ -188,9 +188,9 @@ static int rle_unpack(const unsigned char *src, int src_len, int src_count,
|
|||||||
ps += l;
|
ps += l;
|
||||||
pd += l;
|
pd += l;
|
||||||
} else {
|
} else {
|
||||||
if (dest_end - pd < i || ps_end - ps < 2)
|
if (dest_end - pd < 2*l || ps_end - ps < 2)
|
||||||
return ps - src;
|
return ps - src;
|
||||||
for (i = 0; i < l; i++) {
|
for (j = 0; j < l; j++) {
|
||||||
*pd++ = ps[0];
|
*pd++ = ps[0];
|
||||||
*pd++ = ps[1];
|
*pd++ = ps[1];
|
||||||
}
|
}
|
||||||
|
@@ -1764,7 +1764,7 @@ static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
|
|||||||
const int high_bit_depth = bit_depth > 8;
|
const int high_bit_depth = bit_depth > 8;
|
||||||
|
|
||||||
#if HAVE_SSE2_INLINE
|
#if HAVE_SSE2_INLINE
|
||||||
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) {
|
||||||
c->idct_put = ff_idct_xvid_sse2_put;
|
c->idct_put = ff_idct_xvid_sse2_put;
|
||||||
c->idct_add = ff_idct_xvid_sse2_add;
|
c->idct_add = ff_idct_xvid_sse2_add;
|
||||||
c->idct = ff_idct_xvid_sse2;
|
c->idct = ff_idct_xvid_sse2;
|
||||||
|
@@ -74,7 +74,7 @@ static av_always_inline av_const int64_t MUL64(int a, int b)
|
|||||||
static inline av_const int mid_pred(int a, int b, int c)
|
static inline av_const int mid_pred(int a, int b, int c)
|
||||||
{
|
{
|
||||||
int i=b;
|
int i=b;
|
||||||
__asm__ volatile(
|
__asm__ (
|
||||||
"cmp %2, %1 \n\t"
|
"cmp %2, %1 \n\t"
|
||||||
"cmovg %1, %0 \n\t"
|
"cmovg %1, %0 \n\t"
|
||||||
"cmovg %2, %1 \n\t"
|
"cmovg %2, %1 \n\t"
|
||||||
|
@@ -26,7 +26,7 @@
|
|||||||
#include "libavcodec/mpegvideo.h"
|
#include "libavcodec/mpegvideo.h"
|
||||||
#include "dsputil_mmx.h"
|
#include "dsputil_mmx.h"
|
||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
#if HAVE_MMX_INLINE
|
||||||
|
|
||||||
static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
|
static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
|
||||||
int16_t *block, int n, int qscale)
|
int16_t *block, int n, int qscale)
|
||||||
@@ -574,11 +574,11 @@ static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* HAVE_INLINE_ASM */
|
#endif /* HAVE_MMX_INLINE */
|
||||||
|
|
||||||
av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
||||||
{
|
{
|
||||||
#if HAVE_INLINE_ASM
|
#if HAVE_MMX_INLINE
|
||||||
int mm_flags = av_get_cpu_flags();
|
int mm_flags = av_get_cpu_flags();
|
||||||
|
|
||||||
if (mm_flags & AV_CPU_FLAG_MMX) {
|
if (mm_flags & AV_CPU_FLAG_MMX) {
|
||||||
@@ -596,5 +596,5 @@ av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
|||||||
s->denoise_dct= denoise_dct_mmx;
|
s->denoise_dct= denoise_dct_mmx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* HAVE_INLINE_ASM */
|
#endif /* HAVE_MMX_INLINE */
|
||||||
}
|
}
|
||||||
|
@@ -43,7 +43,7 @@ void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,
|
|||||||
void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
|
void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
|
||||||
int *bounding_values);
|
int *bounding_values);
|
||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
#if HAVE_MMX_INLINE
|
||||||
|
|
||||||
#define MOVQ_BFE(regd) \
|
#define MOVQ_BFE(regd) \
|
||||||
__asm__ volatile ( \
|
__asm__ volatile ( \
|
||||||
@@ -95,15 +95,15 @@ static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const u
|
|||||||
:"memory");
|
:"memory");
|
||||||
// STOP_TIMER("put_vp_no_rnd_pixels8_l2_mmx")
|
// STOP_TIMER("put_vp_no_rnd_pixels8_l2_mmx")
|
||||||
}
|
}
|
||||||
#endif /* HAVE_INLINE_ASM */
|
#endif /* HAVE_MMX_INLINE */
|
||||||
|
|
||||||
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
|
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
|
||||||
{
|
{
|
||||||
int cpuflags = av_get_cpu_flags();
|
int cpuflags = av_get_cpu_flags();
|
||||||
|
|
||||||
#if HAVE_INLINE_ASM
|
#if HAVE_MMX_INLINE
|
||||||
c->put_no_rnd_pixels_l2 = put_vp_no_rnd_pixels8_l2_mmx;
|
c->put_no_rnd_pixels_l2 = put_vp_no_rnd_pixels8_l2_mmx;
|
||||||
#endif /* HAVE_INLINE_ASM */
|
#endif /* HAVE_MMX_INLINE */
|
||||||
|
|
||||||
#if ARCH_X86_32
|
#if ARCH_X86_32
|
||||||
if (EXTERNAL_MMX(cpuflags)) {
|
if (EXTERNAL_MMX(cpuflags)) {
|
||||||
|
@@ -59,7 +59,7 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
int number, len;
|
int number, len;
|
||||||
|
|
||||||
ptr += strcspn(ptr, "#");
|
ptr += strcspn(ptr, "#");
|
||||||
if (sscanf(ptr, "#define %256s %u", name, &number) != 2) {
|
if (sscanf(ptr, "#define %255s %u", name, &number) != 2) {
|
||||||
av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
|
av_log(avctx, AV_LOG_ERROR, "Unexpected preprocessor directive\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
@@ -78,6 +78,7 @@ struct x11grab {
|
|||||||
int show_region; /**< set by a private option. */
|
int show_region; /**< set by a private option. */
|
||||||
char *framerate; /**< Set by a private option. */
|
char *framerate; /**< Set by a private option. */
|
||||||
|
|
||||||
|
Cursor c;
|
||||||
Window region_win; /**< This is used by show_region option. */
|
Window region_win; /**< This is used by show_region option. */
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -353,7 +354,6 @@ paint_mouse_pointer(XImage *image, struct x11grab *s)
|
|||||||
* Anyone who performs further investigation of the xlib API likely risks
|
* Anyone who performs further investigation of the xlib API likely risks
|
||||||
* permanent brain damage. */
|
* permanent brain damage. */
|
||||||
uint8_t *pix = image->data;
|
uint8_t *pix = image->data;
|
||||||
Cursor c;
|
|
||||||
Window w;
|
Window w;
|
||||||
XSetWindowAttributes attr;
|
XSetWindowAttributes attr;
|
||||||
|
|
||||||
@@ -361,9 +361,10 @@ paint_mouse_pointer(XImage *image, struct x11grab *s)
|
|||||||
if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
|
if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
c = XCreateFontCursor(dpy, XC_left_ptr);
|
if(!s->c)
|
||||||
|
s->c = XCreateFontCursor(dpy, XC_left_ptr);
|
||||||
w = DefaultRootWindow(dpy);
|
w = DefaultRootWindow(dpy);
|
||||||
attr.cursor = c;
|
attr.cursor = s->c;
|
||||||
XChangeWindowAttributes(dpy, w, CWCursor, &attr);
|
XChangeWindowAttributes(dpy, w, CWCursor, &attr);
|
||||||
|
|
||||||
xcim = XFixesGetCursorImage(dpy);
|
xcim = XFixesGetCursorImage(dpy);
|
||||||
|
@@ -117,6 +117,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
|||||||
ff_get_audio_buffer(inlink, AV_PERM_WRITE,
|
ff_get_audio_buffer(inlink, AV_PERM_WRITE,
|
||||||
insamples->audio->nb_samples);
|
insamples->audio->nb_samples);
|
||||||
int ret;
|
int ret;
|
||||||
|
int len;
|
||||||
|
|
||||||
if (!outsamples)
|
if (!outsamples)
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
@@ -126,16 +127,20 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
|||||||
out = (int16_t *)outsamples->data[0];
|
out = (int16_t *)outsamples->data[0];
|
||||||
in = (int16_t *)insamples ->data[0];
|
in = (int16_t *)insamples ->data[0];
|
||||||
|
|
||||||
|
len = FFMIN(NUMTAPS, 2*insamples->audio->nb_samples);
|
||||||
// copy part of new input and process with saved input
|
// copy part of new input and process with saved input
|
||||||
memcpy(taps+NUMTAPS, in, NUMTAPS * sizeof(*taps));
|
memcpy(taps+NUMTAPS, in, len * sizeof(*taps));
|
||||||
out = scalarproduct(taps, taps + NUMTAPS, out);
|
out = scalarproduct(taps, taps + len, out);
|
||||||
|
|
||||||
// process current input
|
// process current input
|
||||||
|
if (2*insamples->audio->nb_samples >= NUMTAPS ){
|
||||||
endin = in + insamples->audio->nb_samples * 2 - NUMTAPS;
|
endin = in + insamples->audio->nb_samples * 2 - NUMTAPS;
|
||||||
scalarproduct(in, endin, out);
|
scalarproduct(in, endin, out);
|
||||||
|
|
||||||
// save part of input for next round
|
// save part of input for next round
|
||||||
memcpy(taps, endin, NUMTAPS * sizeof(*taps));
|
memcpy(taps, endin, NUMTAPS * sizeof(*taps));
|
||||||
|
} else
|
||||||
|
memmove(taps, taps + 2*insamples->audio->nb_samples, NUMTAPS * sizeof(*taps));
|
||||||
|
|
||||||
ret = ff_filter_frame(outlink, outsamples);
|
ret = ff_filter_frame(outlink, outsamples);
|
||||||
avfilter_unref_buffer(insamples);
|
avfilter_unref_buffer(insamples);
|
||||||
|
@@ -91,13 +91,13 @@ static int movie_request_frame(AVFilterLink *outlink);
|
|||||||
static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
|
static AVStream *find_stream(void *log, AVFormatContext *avf, const char *spec)
|
||||||
{
|
{
|
||||||
int i, ret, already = 0, stream_id = -1;
|
int i, ret, already = 0, stream_id = -1;
|
||||||
char type_char, dummy;
|
char type_char[2], dummy;
|
||||||
AVStream *found = NULL;
|
AVStream *found = NULL;
|
||||||
enum AVMediaType type;
|
enum AVMediaType type;
|
||||||
|
|
||||||
ret = sscanf(spec, "d%[av]%d%c", &type_char, &stream_id, &dummy);
|
ret = sscanf(spec, "d%1[av]%d%c", type_char, &stream_id, &dummy);
|
||||||
if (ret >= 1 && ret <= 2) {
|
if (ret >= 1 && ret <= 2) {
|
||||||
type = type_char == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
|
type = type_char[0] == 'v' ? AVMEDIA_TYPE_VIDEO : AVMEDIA_TYPE_AUDIO;
|
||||||
ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
|
ret = av_find_best_stream(avf, type, stream_id, -1, NULL, 0);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",
|
av_log(log, AV_LOG_ERROR, "No %s stream with index '%d' found\n",
|
||||||
|
@@ -332,7 +332,7 @@ static av_cold int init_subtitles(AVFilterContext *ctx, const char *args)
|
|||||||
pkt.size = 0;
|
pkt.size = 0;
|
||||||
while (av_read_frame(fmt, &pkt) >= 0) {
|
while (av_read_frame(fmt, &pkt) >= 0) {
|
||||||
int i, got_subtitle;
|
int i, got_subtitle;
|
||||||
AVSubtitle sub;
|
AVSubtitle sub = {0};
|
||||||
|
|
||||||
if (pkt.stream_index == sid) {
|
if (pkt.stream_index == sid) {
|
||||||
ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);
|
ret = avcodec_decode_subtitle2(dec_ctx, &sub, &got_subtitle, &pkt);
|
||||||
|
@@ -192,7 +192,7 @@ static int aiff_probe(AVProbeData *p)
|
|||||||
static int aiff_read_header(AVFormatContext *s)
|
static int aiff_read_header(AVFormatContext *s)
|
||||||
{
|
{
|
||||||
int ret, size, filesize;
|
int ret, size, filesize;
|
||||||
int64_t offset = 0;
|
int64_t offset = 0, position;
|
||||||
uint32_t tag;
|
uint32_t tag;
|
||||||
unsigned version = AIFF_C_VERSION1;
|
unsigned version = AIFF_C_VERSION1;
|
||||||
AVIOContext *pb = s->pb;
|
AVIOContext *pb = s->pb;
|
||||||
@@ -236,6 +236,7 @@ static int aiff_read_header(AVFormatContext *s)
|
|||||||
goto got_sound;
|
goto got_sound;
|
||||||
break;
|
break;
|
||||||
case MKTAG('I', 'D', '3', ' '):
|
case MKTAG('I', 'D', '3', ' '):
|
||||||
|
position = avio_tell(pb);
|
||||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||||
if (id3v2_extra_meta)
|
if (id3v2_extra_meta)
|
||||||
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
|
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
|
||||||
@@ -243,6 +244,8 @@ static int aiff_read_header(AVFormatContext *s)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||||
|
if (position + size > avio_tell(pb))
|
||||||
|
avio_skip(pb, position + size - avio_tell(pb));
|
||||||
break;
|
break;
|
||||||
case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */
|
case MKTAG('F', 'V', 'E', 'R'): /* Version chunk */
|
||||||
version = avio_rb32(pb);
|
version = avio_rb32(pb);
|
||||||
|
@@ -706,7 +706,9 @@ static int avi_read_header(AVFormatContext *s)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MKTAG('s', 't', 'r', 'd'):
|
case MKTAG('s', 't', 'r', 'd'):
|
||||||
if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
|
if (stream_index >= (unsigned)s->nb_streams
|
||||||
|
|| s->streams[stream_index]->codec->extradata_size
|
||||||
|
|| s->streams[stream_index]->codec->codec_tag == MKTAG('H','2','6','4')) {
|
||||||
avio_skip(pb, size);
|
avio_skip(pb, size);
|
||||||
} else {
|
} else {
|
||||||
uint64_t cur_pos = avio_tell(pb);
|
uint64_t cur_pos = avio_tell(pb);
|
||||||
@@ -1003,10 +1005,10 @@ start_sync:
|
|||||||
|| st->discard >= AVDISCARD_ALL){
|
|| st->discard >= AVDISCARD_ALL){
|
||||||
if (!exit_early) {
|
if (!exit_early) {
|
||||||
ast->frame_offset += get_duration(ast, size);
|
ast->frame_offset += get_duration(ast, size);
|
||||||
}
|
|
||||||
avio_skip(pb, size);
|
avio_skip(pb, size);
|
||||||
goto start_sync;
|
goto start_sync;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (d[2] == 'p' && d[3] == 'c' && size<=4*256+4) {
|
if (d[2] == 'p' && d[3] == 'c' && size<=4*256+4) {
|
||||||
int k = avio_r8(pb);
|
int k = avio_r8(pb);
|
||||||
|
@@ -523,7 +523,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
int size= pkt->size;
|
int size= pkt->size;
|
||||||
|
|
||||||
av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(pkt->dts), avist->packet_count, stream_index);
|
av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(pkt->dts), avist->packet_count, stream_index);
|
||||||
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB){
|
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count){
|
||||||
AVPacket empty_packet;
|
AVPacket empty_packet;
|
||||||
|
|
||||||
if(pkt->dts - avist->packet_count > 60000){
|
if(pkt->dts - avist->packet_count > 60000){
|
||||||
|
@@ -34,6 +34,7 @@ static int dts_probe(AVProbeData *p)
|
|||||||
uint32_t state = -1;
|
uint32_t state = -1;
|
||||||
int markers[3] = {0};
|
int markers[3] = {0};
|
||||||
int sum, max;
|
int sum, max;
|
||||||
|
int64_t diff = 0;
|
||||||
|
|
||||||
buf = p->buf;
|
buf = p->buf;
|
||||||
|
|
||||||
@@ -54,12 +55,16 @@ static int dts_probe(AVProbeData *p)
|
|||||||
if (state == DCA_MARKER_14B_LE)
|
if (state == DCA_MARKER_14B_LE)
|
||||||
if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
|
if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
|
||||||
markers[2]++;
|
markers[2]++;
|
||||||
|
|
||||||
|
if (buf - p->buf >= 4)
|
||||||
|
diff += FFABS(AV_RL16(buf) - AV_RL16(buf-4));
|
||||||
}
|
}
|
||||||
sum = markers[0] + markers[1] + markers[2];
|
sum = markers[0] + markers[1] + markers[2];
|
||||||
max = markers[1] > markers[0];
|
max = markers[1] > markers[0];
|
||||||
max = markers[2] > markers[max] ? 2 : max;
|
max = markers[2] > markers[max] ? 2 : max;
|
||||||
if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
|
if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
|
||||||
markers[max] * 4 > sum * 3)
|
markers[max] * 4 > sum * 3 &&
|
||||||
|
diff / p->buf_size > 200)
|
||||||
return AVPROBE_SCORE_MAX/2+1;
|
return AVPROBE_SCORE_MAX/2+1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -493,11 +493,14 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
return ret;
|
return ret;
|
||||||
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
|
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
|
||||||
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
|
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
|
||||||
|
if (!s->streams[pkt->stream_index]->nb_frames) {
|
||||||
av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
|
av_log(s, AV_LOG_ERROR, "Malformed AAC bitstream detected: "
|
||||||
"use audio bitstream filter 'aac_adtstoasc' to fix it "
|
"use audio bitstream filter 'aac_adtstoasc' to fix it "
|
||||||
"('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
|
"('-bsf:a aac_adtstoasc' option with ffmpeg)\n");
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (flv->delay == AV_NOPTS_VALUE)
|
if (flv->delay == AV_NOPTS_VALUE)
|
||||||
flv->delay = -pkt->dts;
|
flv->delay = -pkt->dts;
|
||||||
|
@@ -93,7 +93,7 @@ typedef struct IdcinDemuxContext {
|
|||||||
|
|
||||||
static int idcin_probe(AVProbeData *p)
|
static int idcin_probe(AVProbeData *p)
|
||||||
{
|
{
|
||||||
unsigned int number;
|
unsigned int number, sample_rate;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This is what you could call a "probabilistic" file check: id CIN
|
* This is what you could call a "probabilistic" file check: id CIN
|
||||||
@@ -122,18 +122,18 @@ static int idcin_probe(AVProbeData *p)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* check the audio sample rate */
|
/* check the audio sample rate */
|
||||||
number = AV_RL32(&p->buf[8]);
|
sample_rate = AV_RL32(&p->buf[8]);
|
||||||
if ((number != 0) && ((number < 8000) | (number > 48000)))
|
if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* check the audio bytes/sample */
|
/* check the audio bytes/sample */
|
||||||
number = AV_RL32(&p->buf[12]);
|
number = AV_RL32(&p->buf[12]);
|
||||||
if (number > 2)
|
if (number > 2 || sample_rate && !number)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* check the audio channels */
|
/* check the audio channels */
|
||||||
number = AV_RL32(&p->buf[16]);
|
number = AV_RL32(&p->buf[16]);
|
||||||
if (number > 2)
|
if (number > 2 || sample_rate && !number)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* return half certainly since this check is a bit sketchy */
|
/* return half certainly since this check is a bit sketchy */
|
||||||
|
@@ -478,5 +478,5 @@ AVInputFormat ff_iff_demuxer = {
|
|||||||
.read_probe = iff_probe,
|
.read_probe = iff_probe,
|
||||||
.read_header = iff_read_header,
|
.read_header = iff_read_header,
|
||||||
.read_packet = iff_read_packet,
|
.read_packet = iff_read_packet,
|
||||||
.flags = AVFMT_GENERIC_INDEX,
|
.flags = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK,
|
||||||
};
|
};
|
||||||
|
@@ -347,6 +347,19 @@ static int modplug_read_seek(AVFormatContext *s, int stream_idx, int64_t ts, int
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char modplug_extensions[] = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm,itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz";
|
||||||
|
|
||||||
|
static int modplug_probe(AVProbeData *p)
|
||||||
|
{
|
||||||
|
if (av_match_ext(p->filename, modplug_extensions)) {
|
||||||
|
if (p->buf_size < 16384)
|
||||||
|
return AVPROBE_SCORE_MAX/4-1;
|
||||||
|
else
|
||||||
|
return AVPROBE_SCORE_MAX/2;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static const AVClass modplug_class = {
|
static const AVClass modplug_class = {
|
||||||
.class_name = "ModPlug demuxer",
|
.class_name = "ModPlug demuxer",
|
||||||
.item_name = av_default_item_name,
|
.item_name = av_default_item_name,
|
||||||
@@ -358,11 +371,11 @@ AVInputFormat ff_libmodplug_demuxer = {
|
|||||||
.name = "libmodplug",
|
.name = "libmodplug",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("ModPlug demuxer"),
|
.long_name = NULL_IF_CONFIG_SMALL("ModPlug demuxer"),
|
||||||
.priv_data_size = sizeof(ModPlugContext),
|
.priv_data_size = sizeof(ModPlugContext),
|
||||||
|
.read_probe = modplug_probe,
|
||||||
.read_header = modplug_read_header,
|
.read_header = modplug_read_header,
|
||||||
.read_packet = modplug_read_packet,
|
.read_packet = modplug_read_packet,
|
||||||
.read_close = modplug_read_close,
|
.read_close = modplug_read_close,
|
||||||
.read_seek = modplug_read_seek,
|
.read_seek = modplug_read_seek,
|
||||||
.extensions = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm"
|
.extensions = modplug_extensions,
|
||||||
",itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz", // compressed mods
|
|
||||||
.priv_class = &modplug_class,
|
.priv_class = &modplug_class,
|
||||||
};
|
};
|
||||||
|
@@ -1916,10 +1916,10 @@ static void matroska_clear_queue(MatroskaDemuxContext *matroska)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
||||||
int size, int type,
|
int* buf_size, int type,
|
||||||
uint32_t **lace_buf, int *laces)
|
uint32_t **lace_buf, int *laces)
|
||||||
{
|
{
|
||||||
int res = 0, n;
|
int res = 0, n, size = *buf_size;
|
||||||
uint8_t *data = *buf;
|
uint8_t *data = *buf;
|
||||||
uint32_t *lace_size;
|
uint32_t *lace_size;
|
||||||
|
|
||||||
@@ -2017,6 +2017,7 @@ static int matroska_parse_laces(MatroskaDemuxContext *matroska, uint8_t **buf,
|
|||||||
|
|
||||||
*buf = data;
|
*buf = data;
|
||||||
*lace_buf = lace_size;
|
*lace_buf = lace_size;
|
||||||
|
*buf_size = size;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@@ -2204,6 +2205,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
|||||||
uint32_t *lace_size = NULL;
|
uint32_t *lace_size = NULL;
|
||||||
int n, flags, laces = 0;
|
int n, flags, laces = 0;
|
||||||
uint64_t num;
|
uint64_t num;
|
||||||
|
int trust_default_duration = 1;
|
||||||
|
|
||||||
if ((n = matroska_ebmlnum_uint(matroska, data, size, &num)) < 0) {
|
if ((n = matroska_ebmlnum_uint(matroska, data, size, &num)) < 0) {
|
||||||
av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
|
av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
|
||||||
@@ -2252,13 +2254,21 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
|||||||
matroska->skip_to_keyframe = 0;
|
matroska->skip_to_keyframe = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = matroska_parse_laces(matroska, &data, size, (flags & 0x06) >> 1,
|
res = matroska_parse_laces(matroska, &data, &size, (flags & 0x06) >> 1,
|
||||||
&lace_size, &laces);
|
&lace_size, &laces);
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
goto end;
|
goto end;
|
||||||
|
|
||||||
if (!block_duration)
|
if (track->audio.samplerate == 8000) {
|
||||||
|
// If this is needed for more codecs, then add them here
|
||||||
|
if (st->codec->codec_id == AV_CODEC_ID_AC3) {
|
||||||
|
if(track->audio.samplerate != st->codec->sample_rate || !st->codec->frame_size)
|
||||||
|
trust_default_duration = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!block_duration && trust_default_duration)
|
||||||
block_duration = track->default_duration * laces / matroska->time_scale;
|
block_duration = track->default_duration * laces / matroska->time_scale;
|
||||||
|
|
||||||
if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time))
|
if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time))
|
||||||
@@ -2359,7 +2369,6 @@ static int matroska_parse_cluster_incremental(MatroskaDemuxContext *matroska)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res < 0) matroska->done = 1;
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -309,14 +309,16 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
|
|||||||
return 0;
|
return 0;
|
||||||
fail:
|
fail:
|
||||||
av_freep(&stream_selection);
|
av_freep(&stream_selection);
|
||||||
mmsh_close(h);
|
|
||||||
av_dlog(NULL, "Connection failed with error %d\n", err);
|
av_dlog(NULL, "Connection failed with error %d\n", err);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mmsh_open(URLContext *h, const char *uri, int flags)
|
static int mmsh_open(URLContext *h, const char *uri, int flags)
|
||||||
{
|
{
|
||||||
return mmsh_open_internal(h, uri, flags, 0, 0);
|
int ret = mmsh_open_internal(h, uri, flags, 0, 0);
|
||||||
|
if (ret < 0)
|
||||||
|
mmsh_close(h);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int handle_chunk_type(MMSHContext *mmsh)
|
static int handle_chunk_type(MMSHContext *mmsh)
|
||||||
|
@@ -880,7 +880,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
|
c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
|
||||||
// set the AVCodecContext duration because the duration of individual tracks
|
// set the AVCodecContext duration because the duration of individual tracks
|
||||||
// may be inaccurate
|
// may be inaccurate
|
||||||
if (c->time_scale > 0)
|
if (c->time_scale > 0 && !c->trex_data)
|
||||||
c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale);
|
c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale);
|
||||||
avio_rb32(pb); /* preferred scale */
|
avio_rb32(pb); /* preferred scale */
|
||||||
|
|
||||||
|
@@ -3173,6 +3173,14 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
memcpy(trk->vos_data, enc->extradata, trk->vos_len);
|
memcpy(trk->vos_data, enc->extradata, trk->vos_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
|
||||||
|
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
|
||||||
|
if (!s->streams[pkt->stream_index]->nb_frames) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
av_log(s, AV_LOG_WARNING, "aac bitstream error\n");
|
||||||
|
}
|
||||||
if (enc->codec_id == AV_CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1) {
|
if (enc->codec_id == AV_CODEC_ID_H264 && trk->vos_len > 0 && *(uint8_t *)trk->vos_data != 1) {
|
||||||
/* from x264 or from bytestream h264 */
|
/* from x264 or from bytestream h264 */
|
||||||
/* nal reformating needed */
|
/* nal reformating needed */
|
||||||
@@ -3183,10 +3191,6 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
} else {
|
} else {
|
||||||
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
|
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
|
||||||
}
|
}
|
||||||
} else if (enc->codec_id == AV_CODEC_ID_AAC && pkt->size > 2 &&
|
|
||||||
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
|
|
||||||
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
|
|
||||||
return -1;
|
|
||||||
} else {
|
} else {
|
||||||
avio_write(pb, pkt->data, size);
|
avio_write(pb, pkt->data, size);
|
||||||
}
|
}
|
||||||
|
@@ -37,9 +37,11 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
int64_t filesize;
|
int64_t filesize;
|
||||||
|
int64_t header_filesize;
|
||||||
int xing_toc;
|
int xing_toc;
|
||||||
int start_pad;
|
int start_pad;
|
||||||
int end_pad;
|
int end_pad;
|
||||||
|
int is_cbr;
|
||||||
} MP3Context;
|
} MP3Context;
|
||||||
|
|
||||||
/* mp3 read */
|
/* mp3 read */
|
||||||
@@ -185,6 +187,9 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
|
|||||||
if (size && frames && !is_cbr)
|
if (size && frames && !is_cbr)
|
||||||
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
|
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
|
||||||
|
|
||||||
|
mp3->is_cbr = is_cbr;
|
||||||
|
mp3->header_filesize = size;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -274,21 +279,33 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
|
|||||||
int flags)
|
int flags)
|
||||||
{
|
{
|
||||||
MP3Context *mp3 = s->priv_data;
|
MP3Context *mp3 = s->priv_data;
|
||||||
AVIndexEntry *ie;
|
AVIndexEntry *ie, ie1;
|
||||||
AVStream *st = s->streams[0];
|
AVStream *st = s->streams[0];
|
||||||
int64_t ret = av_index_search_timestamp(st, timestamp, flags);
|
int64_t ret = av_index_search_timestamp(st, timestamp, flags);
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
if (!mp3->xing_toc) {
|
if (mp3->is_cbr && st->duration > 0 && mp3->header_filesize > s->data_offset) {
|
||||||
|
int64_t filesize = avio_size(s->pb);
|
||||||
|
int64_t duration;
|
||||||
|
if (filesize <= s->data_offset)
|
||||||
|
filesize = mp3->header_filesize;
|
||||||
|
filesize -= s->data_offset;
|
||||||
|
duration = av_rescale(st->duration, filesize, mp3->header_filesize - s->data_offset);
|
||||||
|
ie = &ie1;
|
||||||
|
timestamp = av_clip64(timestamp, 0, duration);
|
||||||
|
ie->timestamp = timestamp;
|
||||||
|
ie->pos = av_rescale(timestamp, filesize, duration) + s->data_offset;
|
||||||
|
} else if (mp3->xing_toc) {
|
||||||
|
if (ret < 0)
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
ie = &st->index_entries[ret];
|
||||||
|
} else {
|
||||||
st->skip_samples = timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;
|
st->skip_samples = timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
ie = &st->index_entries[ret];
|
|
||||||
ret = avio_seek(s->pb, ie->pos, SEEK_SET);
|
ret = avio_seek(s->pb, ie->pos, SEEK_SET);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
@@ -208,9 +208,6 @@ static void clear_program(MpegTSContext *ts, unsigned int programid)
|
|||||||
|
|
||||||
static void clear_programs(MpegTSContext *ts)
|
static void clear_programs(MpegTSContext *ts)
|
||||||
{
|
{
|
||||||
int i;
|
|
||||||
for(i=0; i<ts->nb_prg; i++)
|
|
||||||
clear_avprogram(ts, ts->prg[i].id);
|
|
||||||
av_freep(&ts->prg);
|
av_freep(&ts->prg);
|
||||||
ts->nb_prg=0;
|
ts->nb_prg=0;
|
||||||
}
|
}
|
||||||
@@ -1625,17 +1622,34 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
|||||||
if (sid == 0x0000) {
|
if (sid == 0x0000) {
|
||||||
/* NIT info */
|
/* NIT info */
|
||||||
} else {
|
} else {
|
||||||
|
MpegTSFilter *fil = ts->pids[pmt_pid];
|
||||||
program = av_new_program(ts->stream, sid);
|
program = av_new_program(ts->stream, sid);
|
||||||
program->program_num = sid;
|
program->program_num = sid;
|
||||||
program->pmt_pid = pmt_pid;
|
program->pmt_pid = pmt_pid;
|
||||||
if (ts->pids[pmt_pid])
|
if (fil)
|
||||||
|
if ( fil->type != MPEGTS_SECTION
|
||||||
|
|| fil->pid != pmt_pid
|
||||||
|
|| fil->u.section_filter.section_cb != pmt_cb)
|
||||||
mpegts_close_filter(ts, ts->pids[pmt_pid]);
|
mpegts_close_filter(ts, ts->pids[pmt_pid]);
|
||||||
|
|
||||||
|
if (!ts->pids[pmt_pid])
|
||||||
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
|
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
|
||||||
add_pat_entry(ts, sid);
|
add_pat_entry(ts, sid);
|
||||||
add_pid_to_pmt(ts, sid, 0); //add pat pid to program
|
add_pid_to_pmt(ts, sid, 0); //add pat pid to program
|
||||||
add_pid_to_pmt(ts, sid, pmt_pid);
|
add_pid_to_pmt(ts, sid, pmt_pid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (sid < 0) {
|
||||||
|
int i,j;
|
||||||
|
for (j=0; j<ts->stream->nb_programs; j++) {
|
||||||
|
for (i=0; i<ts->nb_prg; i++)
|
||||||
|
if (ts->prg[i].id == ts->stream->programs[j]->id)
|
||||||
|
break;
|
||||||
|
if (i==ts->nb_prg)
|
||||||
|
clear_avprogram(ts, ts->stream->programs[j]->id);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
|
static void sdt_cb(MpegTSFilter *filter, const uint8_t *section, int section_len)
|
||||||
|
@@ -1600,8 +1600,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
|
|||||||
}
|
}
|
||||||
if (descriptor->extradata) {
|
if (descriptor->extradata) {
|
||||||
st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (st->codec->extradata)
|
if (st->codec->extradata) {
|
||||||
memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
|
memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
|
||||||
|
st->codec->extradata_size = descriptor->extradata_size;
|
||||||
|
}
|
||||||
} else if(st->codec->codec_id == CODEC_ID_H264) {
|
} else if(st->codec->codec_id == CODEC_ID_H264) {
|
||||||
ff_generate_avci_extradata(st);
|
ff_generate_avci_extradata(st);
|
||||||
}
|
}
|
||||||
|
@@ -37,6 +37,9 @@ static int skeleton_header(AVFormatContext *s, int idx)
|
|||||||
strcpy(st->codec->codec_name, "skeleton");
|
strcpy(st->codec->codec_name, "skeleton");
|
||||||
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
||||||
|
|
||||||
|
if ((os->flags & OGG_FLAG_EOS) && os->psize == 0)
|
||||||
|
return 1;
|
||||||
|
|
||||||
if (os->psize < 8)
|
if (os->psize < 8)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@@ -74,12 +77,16 @@ static int skeleton_header(AVFormatContext *s, int idx)
|
|||||||
|
|
||||||
target_idx = ogg_find_stream(ogg, AV_RL32(buf+12));
|
target_idx = ogg_find_stream(ogg, AV_RL32(buf+12));
|
||||||
start_granule = AV_RL64(buf+36);
|
start_granule = AV_RL64(buf+36);
|
||||||
if (os->start_granule != OGG_NOGRANULE_VALUE) {
|
if (target_idx < 0) {
|
||||||
av_log_missing_feature(s,
|
av_log(s, AV_LOG_WARNING, "Serial number in fisbone doesn't match any stream\n");
|
||||||
"Multiple fisbone for the same stream", 0);
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) {
|
os = ogg->streams + target_idx;
|
||||||
|
if (os->start_granule != OGG_NOGRANULE_VALUE) {
|
||||||
|
av_log(s, AV_LOG_WARNING, "Multiple fisbone for the same stream\n");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (start_granule != OGG_NOGRANULE_VALUE) {
|
||||||
os->start_granule = start_granule;
|
os->start_granule = start_granule;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -95,13 +95,14 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rm_read_metadata(AVFormatContext *s, int wide)
|
static void rm_read_metadata(AVFormatContext *s, AVIOContext *pb, int wide)
|
||||||
{
|
{
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
|
for (i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
|
||||||
int len = wide ? avio_rb16(s->pb) : avio_r8(s->pb);
|
int len = wide ? avio_rb16(pb) : avio_r8(pb);
|
||||||
get_strl(s->pb, buf, sizeof(buf), len);
|
get_strl(pb, buf, sizeof(buf), len);
|
||||||
av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0);
|
av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -134,7 +135,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
|||||||
avio_skip(pb, 8);
|
avio_skip(pb, 8);
|
||||||
bytes_per_minute = avio_rb16(pb);
|
bytes_per_minute = avio_rb16(pb);
|
||||||
avio_skip(pb, 4);
|
avio_skip(pb, 4);
|
||||||
rm_read_metadata(s, 0);
|
rm_read_metadata(s, pb, 0);
|
||||||
if ((startpos + header_size) >= avio_tell(pb) + 2) {
|
if ((startpos + header_size) >= avio_tell(pb) + 2) {
|
||||||
// fourcc (should always be "lpcJ")
|
// fourcc (should always be "lpcJ")
|
||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
@@ -293,7 +294,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
|||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
avio_r8(pb);
|
avio_r8(pb);
|
||||||
rm_read_metadata(s, 0);
|
rm_read_metadata(s, pb, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
@@ -516,7 +517,7 @@ static int rm_read_header(AVFormatContext *s)
|
|||||||
flags = avio_rb16(pb); /* flags */
|
flags = avio_rb16(pb); /* flags */
|
||||||
break;
|
break;
|
||||||
case MKTAG('C', 'O', 'N', 'T'):
|
case MKTAG('C', 'O', 'N', 'T'):
|
||||||
rm_read_metadata(s, 1);
|
rm_read_metadata(s, pb, 1);
|
||||||
break;
|
break;
|
||||||
case MKTAG('M', 'D', 'P', 'R'):
|
case MKTAG('M', 'D', 'P', 'R'):
|
||||||
st = avformat_new_stream(s, NULL);
|
st = avformat_new_stream(s, NULL);
|
||||||
@@ -1000,6 +1001,18 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index,
|
|||||||
return dts;
|
return dts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int rm_read_seek(AVFormatContext *s, int stream_index,
|
||||||
|
int64_t pts, int flags)
|
||||||
|
{
|
||||||
|
RMDemuxContext *rm = s->priv_data;
|
||||||
|
|
||||||
|
if (ff_seek_frame_binary(s, stream_index, pts, flags) < 0)
|
||||||
|
return -1;
|
||||||
|
rm->audio_pkt_cnt = 0;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
AVInputFormat ff_rm_demuxer = {
|
AVInputFormat ff_rm_demuxer = {
|
||||||
.name = "rm",
|
.name = "rm",
|
||||||
.long_name = NULL_IF_CONFIG_SMALL("RealMedia"),
|
.long_name = NULL_IF_CONFIG_SMALL("RealMedia"),
|
||||||
@@ -1009,6 +1022,7 @@ AVInputFormat ff_rm_demuxer = {
|
|||||||
.read_packet = rm_read_packet,
|
.read_packet = rm_read_packet,
|
||||||
.read_close = rm_read_close,
|
.read_close = rm_read_close,
|
||||||
.read_timestamp = rm_read_dts,
|
.read_timestamp = rm_read_dts,
|
||||||
|
.read_seek = rm_read_seek,
|
||||||
};
|
};
|
||||||
|
|
||||||
AVInputFormat ff_rdt_demuxer = {
|
AVInputFormat ff_rdt_demuxer = {
|
||||||
|
@@ -276,7 +276,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
} else if(t & 0x40){ /* copy with offset */
|
} else if(t & 0x40){ /* copy with offset */
|
||||||
off = avio_r8(s->pb);
|
off = avio_r8(s->pb);
|
||||||
j = (t & 0x3F) + 1;
|
j = (t & 0x3F) + 1;
|
||||||
if (off + j > 0xff) {
|
if (off + j - 1 > 0xff) {
|
||||||
av_log(s, AV_LOG_ERROR,
|
av_log(s, AV_LOG_ERROR,
|
||||||
"Invalid palette update, offset=%d length=%d extends beyond palette size\n",
|
"Invalid palette update, offset=%d length=%d extends beyond palette size\n",
|
||||||
off, j);
|
off, j);
|
||||||
|
@@ -1457,6 +1457,9 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
|
|||||||
st->skip_to_keyframe = 0;
|
st->skip_to_keyframe = 0;
|
||||||
if (st->skip_to_keyframe) {
|
if (st->skip_to_keyframe) {
|
||||||
av_free_packet(&cur_pkt);
|
av_free_packet(&cur_pkt);
|
||||||
|
if (got_packet) {
|
||||||
|
*pkt = cur_pkt;
|
||||||
|
}
|
||||||
got_packet = 0;
|
got_packet = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1859,14 +1862,16 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(ts_max == AV_NOPTS_VALUE){
|
if(ts_max == AV_NOPTS_VALUE){
|
||||||
int step= 1024;
|
int64_t step= 1024;
|
||||||
|
int64_t limit;
|
||||||
filesize = avio_size(s->pb);
|
filesize = avio_size(s->pb);
|
||||||
pos_max = filesize - 1;
|
pos_max = filesize - 1;
|
||||||
do{
|
do{
|
||||||
|
limit = pos_max;
|
||||||
pos_max = FFMAX(0, pos_max - step);
|
pos_max = FFMAX(0, pos_max - step);
|
||||||
ts_max = ff_read_timestamp(s, stream_index, &pos_max, pos_max + step, read_timestamp);
|
ts_max = ff_read_timestamp(s, stream_index, &pos_max, limit, read_timestamp);
|
||||||
step += step;
|
step += step;
|
||||||
}while(ts_max == AV_NOPTS_VALUE && pos_max > 0);
|
}while(ts_max == AV_NOPTS_VALUE && 2*limit > step);
|
||||||
if (ts_max == AV_NOPTS_VALUE)
|
if (ts_max == AV_NOPTS_VALUE)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
@@ -26,6 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
#include "common.h"
|
||||||
#include "mathematics.h"
|
#include "mathematics.h"
|
||||||
#include "intfloat_readwrite.h"
|
#include "intfloat_readwrite.h"
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ AVExtFloat av_dbl2ext(double d){
|
|||||||
ext.mantissa[i] = m>>(56-(i<<3));
|
ext.mantissa[i] = m>>(56-(i<<3));
|
||||||
} else if (f != 0.0) {
|
} else if (f != 0.0) {
|
||||||
ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff;
|
ext.exponent[0] = 0x7f; ext.exponent[1] = 0xff;
|
||||||
if (f != INFINITY)
|
if (!isinf(f))
|
||||||
ext.mantissa[0] = ~0;
|
ext.mantissa[0] = ~0;
|
||||||
}
|
}
|
||||||
if (d < 0)
|
if (d < 0)
|
||||||
|
@@ -178,7 +178,7 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
|
|||||||
if (parent && *parent) {
|
if (parent && *parent) {
|
||||||
snprintf(part[0], part_size, "[%s @ %p] ",
|
snprintf(part[0], part_size, "[%s @ %p] ",
|
||||||
(*parent)->item_name(parent), parent);
|
(*parent)->item_name(parent), parent);
|
||||||
if(type) type[0] = get_category(((uint8_t *) ptr) + avc->parent_log_context_offset);
|
if(type) type[0] = get_category(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
snprintf(part[1], part_size, "[%s @ %p] ",
|
snprintf(part[1], part_size, "[%s @ %p] ",
|
||||||
|
@@ -95,7 +95,11 @@ void *av_malloc(size_t size)
|
|||||||
#elif HAVE_ALIGNED_MALLOC
|
#elif HAVE_ALIGNED_MALLOC
|
||||||
ptr = _aligned_malloc(size, ALIGN);
|
ptr = _aligned_malloc(size, ALIGN);
|
||||||
#elif HAVE_MEMALIGN
|
#elif HAVE_MEMALIGN
|
||||||
|
#ifndef __DJGPP__
|
||||||
ptr = memalign(ALIGN, size);
|
ptr = memalign(ALIGN, size);
|
||||||
|
#else
|
||||||
|
ptr = memalign(size, ALIGN);
|
||||||
|
#endif
|
||||||
/* Why 64?
|
/* Why 64?
|
||||||
* Indeed, we should align it:
|
* Indeed, we should align it:
|
||||||
* on 4 for 386
|
* on 4 for 386
|
||||||
|
@@ -195,7 +195,12 @@ cglobal %2_to_%1_%3, 3, 3, 6, dst, src, len
|
|||||||
add lenq, 2*mmsize/(1<<%4)
|
add lenq, 2*mmsize/(1<<%4)
|
||||||
%endif
|
%endif
|
||||||
jl .next
|
jl .next
|
||||||
|
%if mmsize == 8
|
||||||
|
emms
|
||||||
|
RET
|
||||||
|
%else
|
||||||
REP_RET
|
REP_RET
|
||||||
|
%endif
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro PACK_6CH 5-7
|
%macro PACK_6CH 5-7
|
||||||
|
@@ -724,12 +724,13 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr
|
|||||||
int i;
|
int i;
|
||||||
const uint16_t **src = (const uint16_t **)_src;
|
const uint16_t **src = (const uint16_t **)_src;
|
||||||
uint16_t *dst = (uint16_t *)_dst;
|
uint16_t *dst = (uint16_t *)_dst;
|
||||||
|
int shift = bpc < 16 ? bpc : 14;
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; i++) {
|
||||||
int g = rdpx(src[0] + i);
|
int g = rdpx(src[0] + i);
|
||||||
int b = rdpx(src[1] + i);
|
int b = rdpx(src[1] + i);
|
||||||
int r = rdpx(src[2] + i);
|
int r = rdpx(src[2] + i);
|
||||||
|
|
||||||
dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14));
|
dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -791,13 +792,14 @@ static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
|
|||||||
const uint16_t **src = (const uint16_t **)_src;
|
const uint16_t **src = (const uint16_t **)_src;
|
||||||
uint16_t *dstU = (uint16_t *)_dstU;
|
uint16_t *dstU = (uint16_t *)_dstU;
|
||||||
uint16_t *dstV = (uint16_t *)_dstV;
|
uint16_t *dstV = (uint16_t *)_dstV;
|
||||||
|
int shift = bpc < 16 ? bpc : 14;
|
||||||
for (i = 0; i < width; i++) {
|
for (i = 0; i < width; i++) {
|
||||||
int g = rdpx(src[0] + i);
|
int g = rdpx(src[0] + i);
|
||||||
int b = rdpx(src[1] + i);
|
int b = rdpx(src[1] + i);
|
||||||
int r = rdpx(src[2] + i);
|
int r = rdpx(src[2] + i);
|
||||||
|
|
||||||
dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14);
|
dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14);
|
||||||
dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14);
|
dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#undef rdpx
|
#undef rdpx
|
||||||
|
@@ -1 +1 @@
|
|||||||
a39d7e299a8e25b4ffece0f8d64bf19e
|
9615088d613931b50fd5016c7535b99a
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
808ea110635774252439722a48329d61 *./tests/data/images/dpx/02.dpx
|
d2f0b4e854fda2d3b3bee84cef80593c *./tests/data/images/dpx/02.dpx
|
||||||
./tests/data/images/dpx/%02d.dpx CRC=0x6da01946
|
./tests/data/images/dpx/%02d.dpx CRC=0x6da01946
|
||||||
305792 ./tests/data/images/dpx/02.dpx
|
305792 ./tests/data/images/dpx/02.dpx
|
||||||
5e1a777fa3f4094c9c4dd989cf9e8e8b *./tests/data/images/dpx/02.dpx
|
075963c3c08978b6a20555ba09161434 *./tests/data/images/dpx/02.dpx
|
||||||
./tests/data/images/dpx/%02d.dpx CRC=0xe5b9c023
|
./tests/data/images/dpx/%02d.dpx CRC=0xe5b9c023
|
||||||
609920 ./tests/data/images/dpx/02.dpx
|
609920 ./tests/data/images/dpx/02.dpx
|
||||||
13dc41b1e1e36399a5e1f8b7e3344a81 *./tests/data/images/dpx/02.dpx
|
b9f22728f8ff393bf30cf6cbd624fa95 *./tests/data/images/dpx/02.dpx
|
||||||
./tests/data/images/dpx/%02d.dpx CRC=0xb6310a70
|
./tests/data/images/dpx/%02d.dpx CRC=0xb6310a70
|
||||||
407168 ./tests/data/images/dpx/02.dpx
|
407168 ./tests/data/images/dpx/02.dpx
|
||||||
|
Reference in New Issue
Block a user