Compare commits
91 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d005e2ecce | ||
![]() |
57bdb3f3dd | ||
![]() |
5e34dded10 | ||
![]() |
45ca270ec9 | ||
![]() |
ca2ccd85d7 | ||
![]() |
437f6fb488 | ||
![]() |
f913da3e15 | ||
![]() |
ed9c6529f0 | ||
![]() |
aa40bbb492 | ||
![]() |
8e276fc96a | ||
![]() |
4a4e30a6d8 | ||
![]() |
1c733a440a | ||
![]() |
5c3bc127ca | ||
![]() |
be94d15a03 | ||
![]() |
9c57328b81 | ||
![]() |
6952f6f39b | ||
![]() |
6359be6751 | ||
![]() |
beb55b3981 | ||
![]() |
80aec733ad | ||
![]() |
77bb6b5bcc | ||
![]() |
f68395f7fc | ||
![]() |
eefb6b654d | ||
![]() |
d18d48def6 | ||
![]() |
8df77c3758 | ||
![]() |
08f56b846c | ||
![]() |
f903147f2d | ||
![]() |
9a840d5e17 | ||
![]() |
9e43d92d6a | ||
![]() |
e13e928baa | ||
![]() |
d3bfb66a66 | ||
![]() |
17a6ca7d31 | ||
![]() |
8a20224059 | ||
![]() |
29ee8b72c4 | ||
![]() |
25864cf562 | ||
![]() |
f74206cb40 | ||
![]() |
148d9cd122 | ||
![]() |
bc259185cb | ||
![]() |
3b6bde3b3d | ||
![]() |
4f187f0af1 | ||
![]() |
10c2d22ba1 | ||
![]() |
35738e5898 | ||
![]() |
59d98fc050 | ||
![]() |
60bfa9154d | ||
![]() |
9794727ccd | ||
![]() |
b88de7b31a | ||
![]() |
11420649d0 | ||
![]() |
dbf5d7e5cd | ||
![]() |
6badd558ce | ||
![]() |
a1fe3b4150 | ||
![]() |
c5129da726 | ||
![]() |
fc57959fd5 | ||
![]() |
83956309cc | ||
![]() |
ed15be7519 | ||
![]() |
6928193493 | ||
![]() |
a72b7286e6 | ||
![]() |
901e275697 | ||
![]() |
7a6b5d7a86 | ||
![]() |
fdfe94f4b1 | ||
![]() |
b63ec0cb0f | ||
![]() |
2eb72d5bdc | ||
![]() |
638c3aca64 | ||
![]() |
76d59f1b34 | ||
![]() |
aa0a8ef50e | ||
![]() |
d6173ae341 | ||
![]() |
3ed27832e7 | ||
![]() |
594b1fa961 | ||
![]() |
7a1262fca3 | ||
![]() |
6d2219e9f9 | ||
![]() |
7c2d152f56 | ||
![]() |
1f58590e1e | ||
![]() |
64bbbcd7b0 | ||
![]() |
de9d3f22f0 | ||
![]() |
ea5bb5613f | ||
![]() |
c61ac696e5 | ||
![]() |
6a250c858e | ||
![]() |
5411040802 | ||
![]() |
ab1ea597bd | ||
![]() |
ee606fd031 | ||
![]() |
2f71aeb301 | ||
![]() |
65259b4d68 | ||
![]() |
8f53d32dfb | ||
![]() |
fcc6568a10 | ||
![]() |
489d066d49 | ||
![]() |
9cb45f6ad2 | ||
![]() |
0f04e2741e | ||
![]() |
84642ec879 | ||
![]() |
bef4d9bf87 | ||
![]() |
bc4f6ae88e | ||
![]() |
2678b25099 | ||
![]() |
e322496054 | ||
![]() |
7fa72ff19c |
26
Changelog
26
Changelog
@ -1,7 +1,31 @@
|
||||
Entries are sorted chronologically from oldest to youngest within each release,
|
||||
releases are sorted from youngest to oldest.
|
||||
|
||||
version <next>:
|
||||
version 2.3.3:
|
||||
- h264: fix grayscale only decoding with weighted prediction
|
||||
- mjpegdec: support AV_PIX_FMT_YUV420P16 with upscale_h
|
||||
- proresenc_ks: fix buffer overflow
|
||||
- matroskadec: fix crash
|
||||
|
||||
version 2.3.2:
|
||||
- snow: fix null pointer dereference
|
||||
- huffyucdec: fix overread
|
||||
- vc1dec: fix crash
|
||||
- iff: fix out of array access
|
||||
- matroskaenc: fix assertion failure
|
||||
- cdgraphics: fix infinite loop
|
||||
- dvdsub_parser: fix infinite loop
|
||||
- mpeg12dec: support decoding some broken files
|
||||
- v4l2enc: fix crash
|
||||
- h264_parser: fix handling huge resolutions
|
||||
- h264_mp4toannexb_bsf: multiple bugfixes
|
||||
|
||||
version 2.3.1:
|
||||
- public AVDCT API/ABI for DCT functions
|
||||
- g2meet: allow size changes within original sizes
|
||||
- dv: improved error resilience, fixing Ticket2340 and Ticket2341
|
||||
|
||||
version 2.3:
|
||||
- AC3 fixed-point decoding
|
||||
- shuffleplanes filter
|
||||
- subfile protocol
|
||||
|
@ -528,8 +528,8 @@ x86 Michael Niedermayer
|
||||
Releases
|
||||
========
|
||||
|
||||
2.3 Michael Niedermayer
|
||||
2.2 Michael Niedermayer
|
||||
2.1 Michael Niedermayer
|
||||
1.2 Michael Niedermayer
|
||||
|
||||
If you want to maintain an older release, please contact us
|
||||
|
@ -7,9 +7,10 @@
|
||||
since the release of FFmpeg 2.2.
|
||||
|
||||
In this release, there are lots of internal overhauls that make FFmpeg a
|
||||
more accessible project for new developers. Many important new features
|
||||
like QTKit and AVFoundation input devices are committed. Contributions done
|
||||
by Libav such as a new native Opus decoder are also merged.
|
||||
more accessible project for new developers. Many important new
|
||||
optimizations and features like QTKit and AVFoundation input devices are
|
||||
committed. Contributions done by Libav such as a new native Opus decoder
|
||||
are also merged.
|
||||
|
||||
Because of the increasing difficulty to maintain and lack of maintainers,
|
||||
we are very sorry to say that we have removed all Blackfin and SPARC
|
||||
@ -17,8 +18,9 @@
|
||||
interested in maintaining optimization for these two architecture, feel
|
||||
free to contact us and we will restore the code!
|
||||
|
||||
Since this release, the traditional Changelog file is upgraded to this
|
||||
modern-looking release note. Old changelogs are moved to doc/Changelog.old.
|
||||
Oh, and since this release, this modern-looking release note is provided in
|
||||
addition to the old-style Changelog file, to make it easier for you to
|
||||
focus on the most important features in this release.
|
||||
|
||||
Enjoy!
|
||||
|
||||
@ -33,9 +35,9 @@
|
||||
|
||||
• libavutil 52.92.100
|
||||
• libavcodec 55.69.100
|
||||
• libavformat 55.47.100
|
||||
• libavformat 55.48.100
|
||||
• libavdevice 55.13.102
|
||||
• libavfilter 4.10.100
|
||||
• libavfilter 4.11.100
|
||||
• libswscale 2. 6.100
|
||||
• libswresample 0.19.100
|
||||
• libpostproc 52. 3.100
|
||||
@ -103,7 +105,7 @@
|
||||
Other interesting new features including hqx video filter, a pixel art
|
||||
scaling filter; a fixed-point AC-3 decoder contributed by Imagination
|
||||
Technologies; an On2 TrueMotion VP7 video decoder; an HTML5 WebVTT
|
||||
subtitle decoder that allows creation of WebVTT from any text-based
|
||||
subtitle encoder that allows creation of WebVTT from any text-based
|
||||
subtitles; and an 1-bit Direct Stream Digital audio decoder.
|
||||
|
||||
┌────────────────────────────┐
|
||||
|
1
configure
vendored
1
configure
vendored
@ -4528,6 +4528,7 @@ EOF
|
||||
fi
|
||||
|
||||
check_ldflags -Wl,--as-needed
|
||||
check_ldflags -Wl,-z,noexecstack
|
||||
|
||||
if check_func dlopen; then
|
||||
ldl=
|
||||
|
@ -15,13 +15,13 @@ libavutil: 2012-10-22
|
||||
|
||||
API changes, most recent first:
|
||||
|
||||
2014-07-14 - xxxxxxx - lavf 55.47.100 - avformat.h
|
||||
2014-07-14 - 62227a7 - lavf 55.47.100 - avformat.h
|
||||
Add av_stream_get_parser()
|
||||
|
||||
2014-07-xx - xxxxxxx - lavu 53.18.0 - display.h
|
||||
2014-07-09 - c67690f / a54f03b - lavu 52.92.100 / 53.18.0 - display.h
|
||||
Add av_display_matrix_flip() to flip the transformation matrix.
|
||||
|
||||
2014-07-xx - xxxxxxx - lavc 55.56.0 - dv_profile.h
|
||||
2014-07-09 - 1b58f13 / f6ee61f - lavc 55.69.100 / 55.56.0 - dv_profile.h
|
||||
Add a public API for DV profile handling.
|
||||
|
||||
2014-06-20 - 0dceefc / 9e500ef - lavu 52.90.100 / 53.17.0 - imgutils.h
|
||||
@ -35,6 +35,10 @@ API changes, most recent first:
|
||||
is now setting AVStream.time_base, instead of AVStream.codec.time_base as was
|
||||
done previously. The old method is now deprecated.
|
||||
|
||||
2014-06-11 - 67d29da - lavc 55.66.101 - avcodec.h
|
||||
Increase FF_INPUT_BUFFER_PADDING_SIZE to 32 due to some corner cases needing
|
||||
it
|
||||
|
||||
2014-06-10 - xxxxxxx - lavf 55.43.100 - avformat.h
|
||||
New field int64_t max_analyze_duration2 instead of deprecated
|
||||
int max_analyze_duration.
|
||||
@ -42,7 +46,7 @@ API changes, most recent first:
|
||||
2014-05-30 - 00759d7 - lavu 52.89.100 - opt.h
|
||||
Add av_opt_copy()
|
||||
|
||||
2014-04-xx - 03bb99a / 0957b27 - lavc 55.66.100 / 55.54.0 - avcodec.h
|
||||
2014-06-01 - 03bb99a / 0957b27 - lavc 55.66.100 / 55.54.0 - avcodec.h
|
||||
Add AVCodecContext.side_data_only_packets to allow encoders to output packets
|
||||
with only side data. This option may become mandatory in the future, so all
|
||||
users are recommended to update their code and enable this option.
|
||||
@ -52,7 +56,7 @@ API changes, most recent first:
|
||||
AVColorTransferCharacteristic, and AVChromaLocation) inside lavu.
|
||||
And add AVFrame fields for them.
|
||||
|
||||
2014-04-xx - bdb2e80 / b2d4565 - lavr 1.3.0 - avresample.h
|
||||
2014-05-29 - bdb2e80 / b2d4565 - lavr 1.3.0 - avresample.h
|
||||
Add avresample_max_output_samples
|
||||
|
||||
2014-05-24 - d858ee7 / 6d21259 - lavf 55.42.100 / 55.19.0 - avformat.h
|
||||
|
@ -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 = 2.3.4
|
||||
|
||||
# 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
|
||||
|
@ -491,7 +491,7 @@ aeval=val(ch)/2:c=same
|
||||
@item
|
||||
Invert phase of the second channel:
|
||||
@example
|
||||
eval=val(0)|-val(1)
|
||||
aeval=val(0)|-val(1)
|
||||
@end example
|
||||
@end itemize
|
||||
|
||||
@ -9318,7 +9318,7 @@ Default value is "all", which will cycle through the list of all tests.
|
||||
|
||||
Some examples:
|
||||
@example
|
||||
testsrc=t=dc_luma
|
||||
mptestsrc=t=dc_luma
|
||||
@end example
|
||||
|
||||
will generate a "dc_luma" test pattern.
|
||||
|
@ -483,6 +483,21 @@ ffplay -f lavfi "movie=test.avi[out0];amovie=test.wav[out1]"
|
||||
|
||||
@end itemize
|
||||
|
||||
@section libcdio
|
||||
|
||||
Audio-CD input device based on cdio.
|
||||
|
||||
To enable this input device during configuration you need libcdio
|
||||
installed on your system.
|
||||
|
||||
This device allows playing and grabbing from an Audio-CD.
|
||||
|
||||
For example to copy with @command{ffmpeg} the entire Audio-CD in /dev/sr0,
|
||||
you may run the command:
|
||||
@example
|
||||
ffmpeg -f libcdio -i /dev/sr0 cd.wav
|
||||
@end example
|
||||
|
||||
@section libdc1394
|
||||
|
||||
IIDC1394 input device, based on libdc1394 and libraw1394.
|
||||
|
11
ffmpeg.c
11
ffmpeg.c
@ -1799,18 +1799,10 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output)
|
||||
for (i = 0; i < nb_filtergraphs; i++)
|
||||
if (ist_in_filtergraph(filtergraphs[i], ist)) {
|
||||
FilterGraph *fg = filtergraphs[i];
|
||||
int j;
|
||||
if (configure_filtergraph(fg) < 0) {
|
||||
av_log(NULL, AV_LOG_FATAL, "Error reinitializing filters!\n");
|
||||
exit_program(1);
|
||||
}
|
||||
for (j = 0; j < fg->nb_outputs; j++) {
|
||||
OutputStream *ost = fg->outputs[j]->ost;
|
||||
if (ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
av_buffersink_set_frame_size(ost->filter->filter,
|
||||
ost->enc_ctx->frame_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3419,7 +3411,7 @@ static int process_input(int file_index)
|
||||
}
|
||||
|
||||
/* add the stream-global side data to the first packet */
|
||||
if (ist->nb_packets == 1)
|
||||
if (ist->nb_packets == 1) {
|
||||
if (ist->st->nb_side_data)
|
||||
av_packet_split_side_data(&pkt);
|
||||
for (i = 0; i < ist->st->nb_side_data; i++) {
|
||||
@ -3435,6 +3427,7 @@ static int process_input(int file_index)
|
||||
|
||||
memcpy(dst_data, src_sd->data, src_sd->size);
|
||||
}
|
||||
}
|
||||
|
||||
if (pkt.dts != AV_NOPTS_VALUE)
|
||||
pkt.dts += av_rescale_q(ifile->ts_offset, AV_TIME_BASE_Q, ist->st->time_base);
|
||||
|
@ -919,6 +919,16 @@ int configure_filtergraph(FilterGraph *fg)
|
||||
}
|
||||
|
||||
fg->reconfiguration = 1;
|
||||
|
||||
for (i = 0; i < fg->nb_outputs; i++) {
|
||||
OutputStream *ost = fg->outputs[i]->ost;
|
||||
if (ost &&
|
||||
ost->enc->type == AVMEDIA_TYPE_AUDIO &&
|
||||
!(ost->enc->capabilities & CODEC_CAP_VARIABLE_FRAME_SIZE))
|
||||
av_buffersink_set_frame_size(ost->filter->filter,
|
||||
ost->enc_ctx->frame_size);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1828,7 +1828,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
/* pick the "best" stream of each type */
|
||||
|
||||
/* video: highest resolution */
|
||||
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
|
||||
if (!o->video_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_VIDEO) != AV_CODEC_ID_NONE) {
|
||||
int area = 0, idx = -1;
|
||||
int qcr = avformat_query_codec(oc->oformat, oc->oformat->video_codec, 0);
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
@ -1850,7 +1850,7 @@ static int open_output_file(OptionsContext *o, const char *filename)
|
||||
}
|
||||
|
||||
/* audio: most channels */
|
||||
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
|
||||
if (!o->audio_disable && av_guess_codec(oc->oformat, NULL, filename, NULL, AVMEDIA_TYPE_AUDIO) != AV_CODEC_ID_NONE) {
|
||||
int channels = 0, idx = -1;
|
||||
for (i = 0; i < nb_input_streams; i++) {
|
||||
ist = input_streams[i];
|
||||
|
@ -2977,6 +2977,8 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
AVDictionaryEntry *entry = av_dict_get(stream->metadata, "title", NULL, 0);
|
||||
int i;
|
||||
|
||||
*pbuffer = NULL;
|
||||
|
||||
avc = avformat_alloc_context();
|
||||
if (avc == NULL || !rtp_format) {
|
||||
return -1;
|
||||
@ -3013,7 +3015,7 @@ static int prepare_sdp_description(FFStream *stream, uint8_t **pbuffer,
|
||||
av_free(avc);
|
||||
av_free(avs);
|
||||
|
||||
return strlen(*pbuffer);
|
||||
return *pbuffer ? strlen(*pbuffer) : AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
static void rtsp_cmd_options(HTTPContext *c, const char *url)
|
||||
|
@ -15,6 +15,7 @@ HEADERS = avcodec.h \
|
||||
|
||||
OBJS = allcodecs.o \
|
||||
audioconvert.o \
|
||||
avdct.o \
|
||||
avpacket.o \
|
||||
avpicture.o \
|
||||
bitstream.o \
|
||||
|
@ -34,7 +34,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
int size;
|
||||
union {
|
||||
uint64_t u64;
|
||||
uint8_t u8[8];
|
||||
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
} tmp;
|
||||
|
||||
tmp.u64 = av_be2ne64(state);
|
||||
|
@ -166,7 +166,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info,
|
||||
int err;
|
||||
union {
|
||||
uint64_t u64;
|
||||
uint8_t u8[8];
|
||||
uint8_t u8[8 + FF_INPUT_BUFFER_PADDING_SIZE];
|
||||
} tmp = { av_be2ne64(state) };
|
||||
AC3HeaderInfo hdr, *phdr = &hdr;
|
||||
GetBitContext gbc;
|
||||
|
@ -263,7 +263,7 @@ static void apply_channel_coupling(AC3EncodeContext *s)
|
||||
energy_cpl = energy[blk][CPL_CH][bnd];
|
||||
energy_ch = energy[blk][ch][bnd];
|
||||
blk1 = blk+1;
|
||||
while (!s->blocks[blk1].new_cpl_coords[ch] && blk1 < s->num_blocks) {
|
||||
while (blk1 < s->num_blocks && !s->blocks[blk1].new_cpl_coords[ch]) {
|
||||
if (s->blocks[blk1].cpl_in_use) {
|
||||
energy_cpl += energy[blk1][CPL_CH][bnd];
|
||||
energy_ch += energy[blk1][ch][bnd];
|
||||
|
124
libavcodec/avdct.c
Normal file
124
libavcodec/avdct.c
Normal file
@ -0,0 +1,124 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Michael Niedermayer <michaelni@gmx.at>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "avcodec.h"
|
||||
#include "idctdsp.h"
|
||||
#include "fdctdsp.h"
|
||||
#include "avdct.h"
|
||||
|
||||
#define OFFSET(x) offsetof(AVDCT,x)
|
||||
#define DEFAULT 0 //should be NAN but it does not work as it is not a constant in glibc as required by ANSI/ISO C
|
||||
//these names are too long to be readable
|
||||
#define V AV_OPT_FLAG_VIDEO_PARAM
|
||||
#define A AV_OPT_FLAG_AUDIO_PARAM
|
||||
#define E AV_OPT_FLAG_ENCODING_PARAM
|
||||
#define D AV_OPT_FLAG_DECODING_PARAM
|
||||
|
||||
static const AVOption avdct_options[] = {
|
||||
{"dct", "DCT algorithm", OFFSET(dct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E, "dct"},
|
||||
{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_AUTO }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
{"fastint", "fast integer (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FASTINT }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
{"int", "accurate integer", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_INT }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
{"mmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_MMX }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
{"altivec", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_ALTIVEC }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
{"faan", "floating point AAN DCT (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_DCT_FAAN }, INT_MIN, INT_MAX, V|E, "dct"},
|
||||
|
||||
{"idct", "select IDCT implementation", OFFSET(idct_algo), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|E|D, "idct"},
|
||||
{"auto", "autoselect a good one (default)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_AUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"int", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_INT }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"simple", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLE }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"simplemmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"arm", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"altivec", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_ALTIVEC }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
#if FF_API_ARCH_SH4
|
||||
{"sh4", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SH4 }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
#endif
|
||||
{"simplearm", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARM }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"simplearmv5te", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV5TE }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"simplearmv6", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEARMV6 }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"simpleneon", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLENEON }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
#if FF_API_ARCH_ALPHA
|
||||
{"simplealpha", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEALPHA }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
#endif
|
||||
{"ipp", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_IPP }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"xvidmmx", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_XVIDMMX }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{"faani", "floating point AAN IDCT (experimental / for debugging)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_FAAN }, INT_MIN, INT_MAX, V|D|E, "idct"},
|
||||
{"simpleauto", "experimental / for debugging", 0, AV_OPT_TYPE_CONST, {.i64 = FF_IDCT_SIMPLEAUTO }, INT_MIN, INT_MAX, V|E|D, "idct"},
|
||||
{NULL},
|
||||
};
|
||||
|
||||
static const AVClass avdct_class = {
|
||||
.class_name = "AVDCT",
|
||||
.option = avdct_options,
|
||||
.version = LIBAVUTIL_VERSION_INT,
|
||||
};
|
||||
|
||||
const AVClass *avcodec_dct_get_class(void)
|
||||
{
|
||||
return &avdct_class;
|
||||
}
|
||||
|
||||
AVDCT *avcodec_dct_alloc(void)
|
||||
{
|
||||
AVDCT *dsp = av_mallocz(sizeof(AVDCT));
|
||||
|
||||
if (!dsp)
|
||||
return NULL;
|
||||
|
||||
dsp->av_class = &avdct_class;
|
||||
av_opt_set_defaults(dsp);
|
||||
|
||||
return dsp;
|
||||
}
|
||||
|
||||
int avcodec_dct_init(AVDCT *dsp)
|
||||
{
|
||||
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
|
||||
|
||||
if (!avctx)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
avctx->idct_algo = dsp->idct_algo;
|
||||
avctx->dct_algo = dsp->dct_algo;
|
||||
|
||||
#define COPY(src, name) memcpy(&dsp->name, &src.name, sizeof(dsp->name))
|
||||
|
||||
#if CONFIG_IDCTDSP
|
||||
{
|
||||
IDCTDSPContext idsp;
|
||||
ff_idctdsp_init(&idsp, avctx);
|
||||
COPY(idsp, idct);
|
||||
COPY(idsp, idct_permutation);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CONFIG_FDCTDSP
|
||||
{
|
||||
FDCTDSPContext fdsp;
|
||||
ff_fdctdsp_init(&fdsp, avctx);
|
||||
COPY(fdsp, fdct);
|
||||
}
|
||||
#endif
|
||||
|
||||
avcodec_close(avctx);
|
||||
av_free(avctx);
|
||||
|
||||
return 0;
|
||||
}
|
78
libavcodec/avdct.h
Normal file
78
libavcodec/avdct.h
Normal file
@ -0,0 +1,78 @@
|
||||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifndef AVCODEC_AVDCT_H
|
||||
#define AVCODEC_AVDCT_H
|
||||
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
/**
|
||||
* AVDCT context.
|
||||
* @note function pointers can be NULL if the specific features have been
|
||||
* disabled at build time.
|
||||
*/
|
||||
typedef struct AVDCT {
|
||||
const AVClass *av_class;
|
||||
|
||||
void (*idct)(int16_t *block /* align 16 */);
|
||||
|
||||
/**
|
||||
* IDCT input permutation.
|
||||
* Several optimized IDCTs need a permutated input (relative to the
|
||||
* normal order of the reference IDCT).
|
||||
* This permutation must be performed before the idct_put/add.
|
||||
* Note, normally this can be merged with the zigzag/alternate scan<br>
|
||||
* An example to avoid confusion:
|
||||
* - (->decode coeffs -> zigzag reorder -> dequant -> reference IDCT -> ...)
|
||||
* - (x -> reference DCT -> reference IDCT -> x)
|
||||
* - (x -> reference DCT -> simple_mmx_perm = idct_permutation
|
||||
* -> simple_idct_mmx -> x)
|
||||
* - (-> decode coeffs -> zigzag reorder -> simple_mmx_perm -> dequant
|
||||
* -> simple_idct_mmx -> ...)
|
||||
*/
|
||||
uint8_t idct_permutation[64];
|
||||
|
||||
void (*fdct)(int16_t *block /* align 16 */);
|
||||
|
||||
|
||||
/**
|
||||
* DCT algorithm.
|
||||
* must use AVOptions to set this field.
|
||||
*/
|
||||
int dct_algo;
|
||||
|
||||
/**
|
||||
* IDCT algorithm.
|
||||
* must use AVOptions to set this field.
|
||||
*/
|
||||
int idct_algo;
|
||||
} AVDCT;
|
||||
|
||||
/**
|
||||
* Allocates a AVDCT context.
|
||||
* This needs to be initialized with avcodec_dct_init() after optionally
|
||||
* configuring it with AVOptions.
|
||||
*
|
||||
* To free it use av_free()
|
||||
*/
|
||||
AVDCT *avcodec_dct_alloc(void);
|
||||
int avcodec_dct_init(AVDCT *);
|
||||
|
||||
const AVClass *avcodec_dct_get_class(void);
|
||||
|
||||
#endif /* AVCODEC_AVDCT_H */
|
@ -32,6 +32,10 @@
|
||||
#include "cabac.h"
|
||||
#include "config.h"
|
||||
|
||||
#ifndef UNCHECKED_BITSTREAM_READER
|
||||
#define UNCHECKED_BITSTREAM_READER !CONFIG_SAFE_BITSTREAM_READER
|
||||
#endif
|
||||
|
||||
#if ARCH_AARCH64
|
||||
# include "aarch64/cabac.h"
|
||||
#endif
|
||||
|
@ -353,10 +353,9 @@ static int cdg_decode_frame(AVCodecContext *avctx,
|
||||
*got_frame = 1;
|
||||
} else {
|
||||
*got_frame = 0;
|
||||
buf_size = 0;
|
||||
}
|
||||
|
||||
return buf_size;
|
||||
return avpkt->size;
|
||||
}
|
||||
|
||||
static av_cold int cdg_decode_end(AVCodecContext *avctx)
|
||||
|
@ -45,8 +45,11 @@ static int dvdsub_parse(AVCodecParserContext *s,
|
||||
DVDSubParseContext *pc = s->priv_data;
|
||||
|
||||
if (pc->packet_index == 0) {
|
||||
if (buf_size < 2)
|
||||
return 0;
|
||||
if (buf_size < 2 || AV_RB16(buf) && buf_size < 6) {
|
||||
if (buf_size)
|
||||
av_log(avctx, AV_LOG_DEBUG, "Parser input %d too small\n", buf_size);
|
||||
return buf_size;
|
||||
}
|
||||
pc->packet_len = AV_RB16(buf);
|
||||
if (pc->packet_len == 0) /* HD-DVD subpicture packet */
|
||||
pc->packet_len = AV_RB32(buf+2);
|
||||
|
@ -90,6 +90,7 @@ typedef struct G2MContext {
|
||||
|
||||
int compression;
|
||||
int width, height, bpp;
|
||||
int orig_width, orig_height;
|
||||
int tile_width, tile_height;
|
||||
int tiles_x, tiles_y, tile_x, tile_y;
|
||||
|
||||
@ -712,8 +713,8 @@ static int g2m_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
c->width = bytestream2_get_be32(&bc);
|
||||
c->height = bytestream2_get_be32(&bc);
|
||||
if (c->width < 16 || c->width > avctx->width ||
|
||||
c->height < 16 || c->height > avctx->height) {
|
||||
if (c->width < 16 || c->width > c->orig_width ||
|
||||
c->height < 16 || c->height > c->orig_height) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Invalid frame dimensions %dx%d\n",
|
||||
c->width, c->height);
|
||||
@ -882,6 +883,10 @@ static av_cold int g2m_decode_init(AVCodecContext *avctx)
|
||||
|
||||
avctx->pix_fmt = AV_PIX_FMT_RGB24;
|
||||
|
||||
// store original sizes and check against those if resize happens
|
||||
c->orig_width = avctx->width;
|
||||
c->orig_height = avctx->height;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -113,6 +113,9 @@ typedef struct RL_VLC_ELEM {
|
||||
* LAST_SKIP_BITS(name, gb, num)
|
||||
* Like SKIP_BITS, to be used if next call is UPDATE_CACHE or CLOSE_READER.
|
||||
*
|
||||
* BITS_LEFT(name, gb)
|
||||
* Return the number of bits left
|
||||
*
|
||||
* For examples see get_bits, show_bits, skip_bits, get_vlc.
|
||||
*/
|
||||
|
||||
@ -179,6 +182,8 @@ typedef struct RL_VLC_ELEM {
|
||||
name ## _index = FFMIN(name ## _size_plus8, name ## _index + (num))
|
||||
#endif
|
||||
|
||||
#define BITS_LEFT(name, gb) ((int)((gb)->size_in_bits - name ## _index))
|
||||
|
||||
#define SKIP_BITS(name, gb, num) \
|
||||
do { \
|
||||
SKIP_CACHE(name, gb, num); \
|
||||
|
@ -248,7 +248,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
|
||||
|
||||
#define STARTCODE_TEST \
|
||||
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
|
||||
if (src[i + 2] != 3) { \
|
||||
if (src[i + 2] != 3 && src[i + 2] != 0) { \
|
||||
/* startcode, so we must be past the end */ \
|
||||
length = i; \
|
||||
} \
|
||||
@ -321,7 +321,7 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src,
|
||||
if (src[si + 2] > 3) {
|
||||
dst[di++] = src[si++];
|
||||
dst[di++] = src[si++];
|
||||
} else if (src[si] == 0 && src[si + 1] == 0) {
|
||||
} else if (src[si] == 0 && src[si + 1] == 0 && src[si + 2] != 0) {
|
||||
if (src[si + 2] == 3) { // escape
|
||||
dst[di++] = 0;
|
||||
dst[di++] = 0;
|
||||
@ -841,10 +841,10 @@ static void decode_postinit(H264Context *h, int setup_finished)
|
||||
stereo->type = AV_STEREO3D_CHECKERBOARD;
|
||||
break;
|
||||
case 1:
|
||||
stereo->type = AV_STEREO3D_LINES;
|
||||
stereo->type = AV_STEREO3D_COLUMNS;
|
||||
break;
|
||||
case 2:
|
||||
stereo->type = AV_STEREO3D_COLUMNS;
|
||||
stereo->type = AV_STEREO3D_LINES;
|
||||
break;
|
||||
case 3:
|
||||
if (h->quincunx_subsampling)
|
||||
|
@ -749,7 +749,7 @@ typedef struct H264Context {
|
||||
|
||||
int16_t slice_row[MAX_SLICES]; ///< to detect when MAX_SLICES is too low
|
||||
|
||||
uint8_t parse_history[4];
|
||||
uint8_t parse_history[6];
|
||||
int parse_history_count;
|
||||
int parse_last_mb;
|
||||
uint8_t *edge_emu_buffer;
|
||||
|
@ -420,10 +420,12 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
||||
int weight1 = 64 - weight0;
|
||||
luma_weight_avg(dest_y, tmp_y, h->mb_linesize,
|
||||
height, 5, weight0, weight1, 0);
|
||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
|
||||
chroma_height, 5, weight0, weight1, 0);
|
||||
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
|
||||
chroma_height, 5, weight0, weight1, 0);
|
||||
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize,
|
||||
chroma_height, 5, weight0, weight1, 0);
|
||||
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize,
|
||||
chroma_height, 5, weight0, weight1, 0);
|
||||
}
|
||||
} else {
|
||||
luma_weight_avg(dest_y, tmp_y, h->mb_linesize, height,
|
||||
h->luma_log2_weight_denom,
|
||||
@ -431,18 +433,20 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
||||
h->luma_weight[refn1][1][0],
|
||||
h->luma_weight[refn0][0][1] +
|
||||
h->luma_weight[refn1][1][1]);
|
||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn0][0][0][0],
|
||||
h->chroma_weight[refn1][1][0][0],
|
||||
h->chroma_weight[refn0][0][0][1] +
|
||||
h->chroma_weight[refn1][1][0][1]);
|
||||
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn0][0][1][0],
|
||||
h->chroma_weight[refn1][1][1][0],
|
||||
h->chroma_weight[refn0][0][1][1] +
|
||||
h->chroma_weight[refn1][1][1][1]);
|
||||
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||
chroma_weight_avg(dest_cb, tmp_cb, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn0][0][0][0],
|
||||
h->chroma_weight[refn1][1][0][0],
|
||||
h->chroma_weight[refn0][0][0][1] +
|
||||
h->chroma_weight[refn1][1][0][1]);
|
||||
chroma_weight_avg(dest_cr, tmp_cr, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn0][0][1][0],
|
||||
h->chroma_weight[refn1][1][1][0],
|
||||
h->chroma_weight[refn0][0][1][1] +
|
||||
h->chroma_weight[refn1][1][1][1]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int list = list1 ? 1 : 0;
|
||||
@ -456,15 +460,17 @@ static av_always_inline void mc_part_weighted(H264Context *h, int n, int square,
|
||||
h->luma_log2_weight_denom,
|
||||
h->luma_weight[refn][list][0],
|
||||
h->luma_weight[refn][list][1]);
|
||||
if (h->use_weight_chroma) {
|
||||
chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn][list][0][0],
|
||||
h->chroma_weight[refn][list][0][1]);
|
||||
chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn][list][1][0],
|
||||
h->chroma_weight[refn][list][1][1]);
|
||||
if (!CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
|
||||
if (h->use_weight_chroma) {
|
||||
chroma_weight_op(dest_cb, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn][list][0][0],
|
||||
h->chroma_weight[refn][list][0][1]);
|
||||
chroma_weight_op(dest_cr, h->mb_uvlinesize, chroma_height,
|
||||
h->chroma_log2_weight_denom,
|
||||
h->chroma_weight[refn][list][1][0],
|
||||
h->chroma_weight[refn][list][1][1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
typedef struct H264BSFContext {
|
||||
uint8_t length_size;
|
||||
uint8_t first_idr;
|
||||
uint8_t idr_sps_pps_seen;
|
||||
int extradata_parsed;
|
||||
} H264BSFContext;
|
||||
|
||||
@ -155,6 +156,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
return ret;
|
||||
ctx->length_size = ret;
|
||||
ctx->first_idr = 1;
|
||||
ctx->idr_sps_pps_seen = 0;
|
||||
ctx->extradata_parsed = 1;
|
||||
}
|
||||
|
||||
@ -174,8 +176,17 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
if (buf + nal_size > buf_end || nal_size < 0)
|
||||
goto fail;
|
||||
|
||||
/* prepend only to the first type 5 NAL unit of an IDR picture */
|
||||
if (ctx->first_idr && (unit_type == 5 || unit_type == 7 || unit_type == 8)) {
|
||||
if (ctx->first_idr && (unit_type == 7 || unit_type == 8))
|
||||
ctx->idr_sps_pps_seen = 1;
|
||||
|
||||
/* if this is a new IDR picture following an IDR picture, reset the idr flag.
|
||||
* Just check first_mb_in_slice to be 0 as this is the simplest solution.
|
||||
* This could be checking idr_pic_id instead, but would complexify the parsing. */
|
||||
if (!ctx->first_idr && unit_type == 5 && (buf[1] & 0x80))
|
||||
ctx->first_idr = 1;
|
||||
|
||||
/* prepend only to the first type 5 NAL unit of an IDR picture, if no sps/pps are already present */
|
||||
if (ctx->first_idr && unit_type == 5 && !ctx->idr_sps_pps_seen) {
|
||||
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
|
||||
avctx->extradata, avctx->extradata_size,
|
||||
buf, nal_size)) < 0)
|
||||
@ -185,8 +196,10 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
|
||||
NULL, 0, buf, nal_size)) < 0)
|
||||
goto fail;
|
||||
if (!ctx->first_idr && unit_type == 1)
|
||||
if (!ctx->first_idr && unit_type == 1) {
|
||||
ctx->first_idr = 1;
|
||||
ctx->idr_sps_pps_seen = 0;
|
||||
}
|
||||
}
|
||||
|
||||
buf += nal_size;
|
||||
|
@ -92,7 +92,7 @@ static int h264_find_frame_end(H264Context *h, const uint8_t *buf,
|
||||
state = 7;
|
||||
} else {
|
||||
h->parse_history[h->parse_history_count++]= buf[i];
|
||||
if (h->parse_history_count>3) {
|
||||
if (h->parse_history_count>5) {
|
||||
unsigned int mb, last_mb= h->parse_last_mb;
|
||||
GetBitContext gb;
|
||||
|
||||
@ -120,7 +120,7 @@ found:
|
||||
pc->frame_start_found = 0;
|
||||
if (h->is_avc)
|
||||
return next_avc;
|
||||
return i - (state & 5) - 3 * (state > 7);
|
||||
return i - (state & 5) - 5 * (state > 7);
|
||||
}
|
||||
|
||||
static int scan_mmco_reset(AVCodecParserContext *s)
|
||||
|
@ -625,9 +625,9 @@ static void decode_422_bitstream(HYuvContext *s, int count)
|
||||
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
|
||||
READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2);
|
||||
}
|
||||
for (; i < count && get_bits_left(&s->gb) > 0; i++) {
|
||||
for (; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||
READ_2PIX(s->temp[0][2 * i ], s->temp[1][i], 1);
|
||||
if (get_bits_left(&s->gb) <= 0) break;
|
||||
if (BITS_LEFT(re, &s->gb) <= 0) break;
|
||||
READ_2PIX(s->temp[0][2 * i + 1], s->temp[2][i], 2);
|
||||
}
|
||||
for (; i < count; i++)
|
||||
@ -666,7 +666,7 @@ static void decode_plane_bitstream(HYuvContext *s, int count, int plane)
|
||||
if (s->bps <= 8) {
|
||||
OPEN_READER(re, &s->gb);
|
||||
if (count >= (get_bits_left(&s->gb)) / (32 * 2)) {
|
||||
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
|
||||
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||
READ_2PIX_PLANE(s->temp[0][2 * i], s->temp[0][2 * i + 1], plane, OP8bits);
|
||||
}
|
||||
} else {
|
||||
@ -678,7 +678,7 @@ static void decode_plane_bitstream(HYuvContext *s, int count, int plane)
|
||||
} else if (s->bps <= 14) {
|
||||
OPEN_READER(re, &s->gb);
|
||||
if (count >= (get_bits_left(&s->gb)) / (32 * 2)) {
|
||||
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
|
||||
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||
READ_2PIX_PLANE(s->temp16[0][2 * i], s->temp16[0][2 * i + 1], plane, OP14bits);
|
||||
}
|
||||
} else {
|
||||
@ -707,7 +707,7 @@ static void decode_gray_bitstream(HYuvContext *s, int count)
|
||||
count/=2;
|
||||
|
||||
if (count >= (get_bits_left(&s->gb)) / (32 * 2)) {
|
||||
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
|
||||
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||
READ_2PIX(s->temp[0][2 * i], s->temp[0][2 * i + 1], 0);
|
||||
}
|
||||
} else {
|
||||
@ -724,7 +724,7 @@ static av_always_inline void decode_bgr_1(HYuvContext *s, int count,
|
||||
int i;
|
||||
OPEN_READER(re, &s->gb);
|
||||
|
||||
for (i = 0; i < count && get_bits_left(&s->gb) > 0; i++) {
|
||||
for (i = 0; i < count && BITS_LEFT(re, &s->gb) > 0; i++) {
|
||||
unsigned int index;
|
||||
int code, n;
|
||||
|
||||
|
@ -677,11 +677,15 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
const uint8_t *buf_end = buf + buf_size;
|
||||
int y, plane, res;
|
||||
GetByteContext gb;
|
||||
const AVPixFmtDescriptor *desc;
|
||||
|
||||
if ((res = extract_header(avctx, avpkt)) < 0)
|
||||
return res;
|
||||
if ((res = ff_reget_buffer(avctx, s->frame)) < 0)
|
||||
return res;
|
||||
|
||||
desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
|
||||
if (!s->init && avctx->bits_per_coded_sample <= 8 &&
|
||||
avctx->pix_fmt == AV_PIX_FMT_PAL8) {
|
||||
if ((res = cmap_read_palette(avctx, (uint32_t *)s->frame->data[1])) < 0)
|
||||
@ -721,7 +725,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
} else
|
||||
return unsupported(avctx);
|
||||
} else if (avctx->codec_tag == MKTAG('D', 'E', 'E', 'P')) {
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
int raw_width = avctx->width * (av_get_bits_per_pixel(desc) >> 3);
|
||||
int x;
|
||||
for (y = 0; y < avctx->height && buf < buf_end; y++) {
|
||||
@ -838,7 +841,6 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
} else
|
||||
return unsupported(avctx);
|
||||
} else if (avctx->codec_tag == MKTAG('D', 'E', 'E', 'P')) { // IFF-DEEP
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
if (av_get_bits_per_pixel(desc) == 32)
|
||||
decode_deep_rle32(s->frame->data[0], buf, buf_size, avctx->width, avctx->height, s->frame->linesize[0]);
|
||||
else
|
||||
@ -847,16 +849,15 @@ static int decode_frame(AVCodecContext *avctx,
|
||||
break;
|
||||
case 4:
|
||||
bytestream2_init(&gb, buf, buf_size);
|
||||
if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8'))
|
||||
if (avctx->codec_tag == MKTAG('R', 'G', 'B', '8') && avctx->pix_fmt == AV_PIX_FMT_RGB32)
|
||||
decode_rgb8(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
|
||||
else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N'))
|
||||
else if (avctx->codec_tag == MKTAG('R', 'G', 'B', 'N') && avctx->pix_fmt == AV_PIX_FMT_RGB444)
|
||||
decode_rgbn(&gb, s->frame->data[0], avctx->width, avctx->height, s->frame->linesize[0]);
|
||||
else
|
||||
return unsupported(avctx);
|
||||
break;
|
||||
case 5:
|
||||
if (avctx->codec_tag == MKTAG('D', 'E', 'E', 'P')) {
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt);
|
||||
if (av_get_bits_per_pixel(desc) == 32)
|
||||
decode_deep_tvdc32(s->frame->data[0], buf, buf_size, avctx->width, avctx->height, s->frame->linesize[0], s->tvdc);
|
||||
else
|
||||
|
@ -269,6 +269,11 @@ static inline void ls_decode_line(JLSState *state, MJpegDecodeContext *s,
|
||||
x += stride;
|
||||
}
|
||||
|
||||
if (x >= w) {
|
||||
av_log(NULL, AV_LOG_ERROR, "run overflow\n");
|
||||
return;
|
||||
}
|
||||
|
||||
/* decode run termination value */
|
||||
Rb = R(last, x);
|
||||
RItype = (FFABS(Ra - Rb) <= state->near) ? 1 : 0;
|
||||
|
@ -96,8 +96,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
|
||||
return ret;
|
||||
|
||||
WebRtcIlbcfix_DecodeImpl((WebRtc_Word16*) frame->data[0],
|
||||
(const WebRtc_UWord16*) buf, &s->decoder, 1);
|
||||
WebRtcIlbcfix_DecodeImpl((int16_t *) frame->data[0], (const uint16_t *) buf, &s->decoder, 1);
|
||||
|
||||
*got_frame_ptr = 1;
|
||||
|
||||
@ -170,7 +169,7 @@ static int ilbc_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, 50)) < 0)
|
||||
return ret;
|
||||
|
||||
WebRtcIlbcfix_EncodeImpl((WebRtc_UWord16*) avpkt->data, (const WebRtc_Word16*) frame->data[0], &s->encoder);
|
||||
WebRtcIlbcfix_EncodeImpl((uint16_t *) avpkt->data, (const int16_t *) frame->data[0], &s->encoder);
|
||||
|
||||
avpkt->size = s->encoder.no_of_bytes;
|
||||
*got_packet_ptr = 1;
|
||||
|
@ -236,10 +236,10 @@ static int X264_frame(AVCodecContext *ctx, AVPacket *pkt, const AVFrame *frame,
|
||||
case AV_STEREO3D_CHECKERBOARD:
|
||||
fpa_type = 0;
|
||||
break;
|
||||
case AV_STEREO3D_LINES:
|
||||
case AV_STEREO3D_COLUMNS:
|
||||
fpa_type = 1;
|
||||
break;
|
||||
case AV_STEREO3D_COLUMNS:
|
||||
case AV_STEREO3D_LINES:
|
||||
fpa_type = 2;
|
||||
break;
|
||||
case AV_STEREO3D_SIDEBYSIDE:
|
||||
|
@ -244,7 +244,7 @@ int ff_mjpeg_decode_dht(MJpegDecodeContext *s)
|
||||
|
||||
int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
{
|
||||
int len, nb_components, i, width, height, pix_fmt_id, ret;
|
||||
int len, nb_components, i, width, height, bits, pix_fmt_id, ret;
|
||||
int h_count[MAX_COMPONENTS];
|
||||
int v_count[MAX_COMPONENTS];
|
||||
|
||||
@ -254,11 +254,11 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
/* XXX: verify len field validity */
|
||||
len = get_bits(&s->gb, 16);
|
||||
s->avctx->bits_per_raw_sample =
|
||||
s->bits = get_bits(&s->gb, 8);
|
||||
bits = get_bits(&s->gb, 8);
|
||||
|
||||
if (s->pegasus_rct)
|
||||
s->bits = 9;
|
||||
if (s->bits == 9 && !s->pegasus_rct)
|
||||
bits = 9;
|
||||
if (bits == 9 && !s->pegasus_rct)
|
||||
s->rct = 1; // FIXME ugly
|
||||
|
||||
if(s->lossless && s->avctx->lowres){
|
||||
@ -291,7 +291,7 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
if (s->ls && !(s->bits <= 8 || nb_components == 1)) {
|
||||
if (s->ls && !(bits <= 8 || nb_components == 1)) {
|
||||
avpriv_report_missing_feature(s->avctx,
|
||||
"JPEG-LS that is not <= 8 "
|
||||
"bits/component or 16-bit gray");
|
||||
@ -337,11 +337,13 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
|
||||
|
||||
/* if different size, realloc/alloc picture */
|
||||
if ( width != s->width || height != s->height
|
||||
|| bits != s->bits
|
||||
|| memcmp(s->h_count, h_count, sizeof(h_count))
|
||||
|| memcmp(s->v_count, v_count, sizeof(v_count))) {
|
||||
|
||||
s->width = width;
|
||||
s->height = height;
|
||||
s->bits = bits;
|
||||
memcpy(s->h_count, h_count, sizeof(h_count));
|
||||
memcpy(s->v_count, v_count, sizeof(v_count));
|
||||
s->interlaced = 0;
|
||||
@ -1894,6 +1896,7 @@ int ff_mjpeg_decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
int start_code;
|
||||
int i, index;
|
||||
int ret = 0;
|
||||
int is16bit;
|
||||
|
||||
av_dict_free(&s->exif_metadata);
|
||||
av_freep(&s->stereo3d);
|
||||
@ -2072,6 +2075,9 @@ fail:
|
||||
s->got_picture = 0;
|
||||
return ret;
|
||||
the_end:
|
||||
|
||||
is16bit = av_pix_fmt_desc_get(s->avctx->pix_fmt)->comp[0].step_minus1;
|
||||
|
||||
if (s->upscale_h) {
|
||||
int p;
|
||||
av_assert0(avctx->pix_fmt == AV_PIX_FMT_YUVJ444P ||
|
||||
@ -2081,6 +2087,7 @@ the_end:
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUVA444P ||
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUVJ420P ||
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUV420P ||
|
||||
avctx->pix_fmt == AV_PIX_FMT_YUV420P16||
|
||||
avctx->pix_fmt == AV_PIX_FMT_GBRAP
|
||||
);
|
||||
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
|
||||
@ -2091,9 +2098,16 @@ the_end:
|
||||
continue;
|
||||
if (p==1 || p==2)
|
||||
w >>= hshift;
|
||||
av_assert0(w > 0);
|
||||
for (i = 0; i < s->chroma_height; i++) {
|
||||
for (index = w - 1; index; index--)
|
||||
line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 1;
|
||||
if (is16bit) ((uint16_t*)line)[w - 1] = ((uint16_t*)line)[(w - 1) / 2];
|
||||
else line[w - 1] = line[(w - 1) / 2];
|
||||
for (index = w - 2; index > 0; index--) {
|
||||
if (is16bit)
|
||||
((uint16_t*)line)[index] = (((uint16_t*)line)[index / 2] + ((uint16_t*)line)[(index + 1) / 2]) >> 1;
|
||||
else
|
||||
line[index] = (line[index / 2] + line[(index + 1) / 2]) >> 1;
|
||||
}
|
||||
line += s->linesize[p];
|
||||
}
|
||||
}
|
||||
@ -2118,7 +2132,7 @@ the_end:
|
||||
for (i = s->height - 1; i; i--) {
|
||||
uint8_t *src1 = &((uint8_t *)s->picture_ptr->data[p])[i / 2 * s->linesize[p]];
|
||||
uint8_t *src2 = &((uint8_t *)s->picture_ptr->data[p])[(i + 1) / 2 * s->linesize[p]];
|
||||
if (src1 == src2) {
|
||||
if (src1 == src2 || i == s->height - 1) {
|
||||
memcpy(dst, src1, w);
|
||||
} else {
|
||||
for (index = 0; index < w; index++)
|
||||
|
@ -1884,6 +1884,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y,
|
||||
} else
|
||||
goto eos;
|
||||
}
|
||||
if (s->mb_y >= ((s->height + 15) >> 4) &&
|
||||
s->progressive_frame &&
|
||||
!s->progressive_sequence &&
|
||||
get_bits_left(&s->gb) <= 8 &&
|
||||
get_bits_left(&s->gb) >= 0 &&
|
||||
s->mb_skip_run == -1 &&
|
||||
show_bits(&s->gb, 8) == 0)
|
||||
goto eos;
|
||||
|
||||
ff_init_block_index(s);
|
||||
}
|
||||
|
@ -1436,6 +1436,9 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
||||
{
|
||||
int i, err = 0;
|
||||
|
||||
if (!s->context_initialized)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
if (s->slice_context_count > 1) {
|
||||
for (i = 0; i < s->slice_context_count; i++) {
|
||||
free_duplicate_context(s->thread_context[i]);
|
||||
@ -1465,8 +1468,8 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
||||
s->mb_height = (s->height + 15) / 16;
|
||||
|
||||
if ((s->width || s->height) &&
|
||||
av_image_check_size(s->width, s->height, 0, s->avctx))
|
||||
return AVERROR_INVALIDDATA;
|
||||
(err = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
|
||||
goto fail;
|
||||
|
||||
if ((err = init_context_frame(s)))
|
||||
goto fail;
|
||||
@ -1482,7 +1485,7 @@ int ff_MPV_common_frame_size_change(MpegEncContext *s)
|
||||
}
|
||||
|
||||
for (i = 0; i < nb_slices; i++) {
|
||||
if (init_duplicate_context(s->thread_context[i]) < 0)
|
||||
if ((err = init_duplicate_context(s->thread_context[i])) < 0)
|
||||
goto fail;
|
||||
s->thread_context[i]->start_mb_y =
|
||||
(s->mb_height * (i) + nb_slices / 2) / nb_slices;
|
||||
|
@ -471,7 +471,6 @@ static void put_alpha_run(PutBitContext *pb, int run)
|
||||
|
||||
// todo alpha quantisation for high quants
|
||||
static int encode_alpha_plane(ProresContext *ctx, PutBitContext *pb,
|
||||
const uint16_t *src, int linesize,
|
||||
int mbs_per_slice, uint16_t *blocks,
|
||||
int quant)
|
||||
{
|
||||
@ -566,11 +565,16 @@ static int encode_slice(AVCodecContext *avctx, const AVFrame *pic,
|
||||
get_alpha_data(ctx, src, linesize, xp, yp,
|
||||
pwidth, avctx->height / ctx->pictures_per_frame,
|
||||
ctx->blocks[0], mbs_per_slice, ctx->alpha_bits);
|
||||
sizes[i] = encode_alpha_plane(ctx, pb, src, linesize,
|
||||
sizes[i] = encode_alpha_plane(ctx, pb,
|
||||
mbs_per_slice, ctx->blocks[0],
|
||||
quant);
|
||||
}
|
||||
total_size += sizes[i];
|
||||
if (put_bits_left(pb) < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Serious underevaluation of"
|
||||
"required buffer size");
|
||||
return AVERROR_BUFFER_TOO_SMALL;
|
||||
}
|
||||
}
|
||||
return total_size;
|
||||
}
|
||||
@ -941,9 +945,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
|
||||
avctx->coded_frame->key_frame = 1;
|
||||
|
||||
pkt_size = ctx->frame_size_upper_bound + FF_MIN_BUFFER_SIZE;
|
||||
pkt_size = ctx->frame_size_upper_bound;
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size)) < 0)
|
||||
if ((ret = ff_alloc_packet2(avctx, pkt, pkt_size + FF_MIN_BUFFER_SIZE)) < 0)
|
||||
return ret;
|
||||
|
||||
orig_buf = pkt->data;
|
||||
@ -1020,7 +1024,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
|
||||
slice_hdr = buf;
|
||||
buf += slice_hdr_size - 1;
|
||||
init_put_bits(&pb, buf, (pkt_size - (buf - orig_buf)) * 8);
|
||||
encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
|
||||
ret = encode_slice(avctx, pic, &pb, sizes, x, y, q, mbs_per_slice);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
bytestream_put_byte(&slice_hdr, q);
|
||||
slice_size = slice_hdr_size + sizes[ctx->num_planes - 1];
|
||||
@ -1202,8 +1208,6 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
ctx->bits_per_mb = ls * 8;
|
||||
if (ctx->chroma_factor == CFACTOR_Y444)
|
||||
ctx->bits_per_mb += ls * 4;
|
||||
if (ctx->num_planes == 4)
|
||||
ctx->bits_per_mb += ls * 4;
|
||||
}
|
||||
|
||||
ctx->frame_size_upper_bound = ctx->pictures_per_frame *
|
||||
@ -1212,6 +1216,14 @@ static av_cold int encode_init(AVCodecContext *avctx)
|
||||
(mps * ctx->bits_per_mb) / 8)
|
||||
+ 200;
|
||||
|
||||
if (ctx->alpha_bits) {
|
||||
// alpha plane is run-coded and might run over bit budget
|
||||
ctx->frame_size_upper_bound += ctx->pictures_per_frame *
|
||||
ctx->slices_per_picture *
|
||||
/* num pixels per slice */ (ctx->mbs_per_slice * 256 *
|
||||
/* bits per pixel */ (1 + ctx->alpha_bits + 1) + 7 >> 3);
|
||||
}
|
||||
|
||||
avctx->codec_tag = ctx->profile_info->tag;
|
||||
|
||||
av_log(avctx, AV_LOG_DEBUG,
|
||||
|
@ -713,7 +713,7 @@ av_cold void ff_snow_common_end(SnowContext *s)
|
||||
for(i=0; i<MAX_REF_FRAMES; i++){
|
||||
av_freep(&s->ref_mvs[i]);
|
||||
av_freep(&s->ref_scores[i]);
|
||||
if(s->last_picture[i]->data[0]) {
|
||||
if(s->last_picture[i] && s->last_picture[i]->data[0]) {
|
||||
av_assert0(s->last_picture[i]->data[0] != s->current_picture->data[0]);
|
||||
}
|
||||
av_frame_free(&s->last_picture[i]);
|
||||
|
@ -659,7 +659,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
|
||||
if(v){
|
||||
v= 2*(get_symbol2(&s->c, b->state[context + 2], context-4) + 1);
|
||||
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3 + ff_quant3bA[l&0xFF] + 3*ff_quant3bA[t&0xFF]]);
|
||||
|
||||
if ((uint16_t)v != v) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
|
||||
v = 1;
|
||||
}
|
||||
xc->x=x;
|
||||
(xc++)->coeff= v;
|
||||
}
|
||||
@ -669,6 +672,10 @@ static inline void unpack_coeffs(SnowContext *s, SubBand *b, SubBand * parent, i
|
||||
else run= INT_MAX;
|
||||
v= 2*(get_symbol2(&s->c, b->state[0 + 2], 0-4) + 1);
|
||||
v+=get_rac(&s->c, &b->state[0][16 + 1 + 3]);
|
||||
if ((uint16_t)v != v) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "Coefficient damaged\n");
|
||||
v = 1;
|
||||
}
|
||||
|
||||
xc->x=x;
|
||||
(xc++)->coeff= v;
|
||||
|
@ -374,6 +374,8 @@ void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
|
||||
case AV_PIX_FMT_GBRP12BE:
|
||||
case AV_PIX_FMT_GBRP14LE:
|
||||
case AV_PIX_FMT_GBRP14BE:
|
||||
case AV_PIX_FMT_GBRP16LE:
|
||||
case AV_PIX_FMT_GBRP16BE:
|
||||
w_align = 16; //FIXME assume 16 pixel per macroblock
|
||||
h_align = 16 * 2; // interlaced needs 2 macroblocks height
|
||||
break;
|
||||
|
@ -5484,7 +5484,7 @@ static int vc1_decode_sprites(VC1Context *v, GetBitContext* gb)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!s->current_picture.f->data[0]) {
|
||||
if (!s->current_picture.f || !s->current_picture.f->data[0]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Got no sprites\n");
|
||||
return -1;
|
||||
}
|
||||
@ -5514,7 +5514,7 @@ static void vc1_sprite_flush(AVCodecContext *avctx)
|
||||
Since we can't enforce it, clear to black the missing sprite. This is
|
||||
wrong but it looks better than doing nothing. */
|
||||
|
||||
if (f->data[0])
|
||||
if (f && f->data[0])
|
||||
for (plane = 0; plane < (s->flags&CODEC_FLAG_GRAY ? 1 : 3); plane++)
|
||||
for (i = 0; i < v->sprite_height>>!!plane; i++)
|
||||
memset(f->data[plane] + i * f->linesize[plane],
|
||||
|
@ -253,6 +253,10 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
|
||||
return sign ? ~ret : ret;
|
||||
|
||||
error:
|
||||
ret = get_bits_left(gb);
|
||||
if (ret <= 0) {
|
||||
av_log(ctx->avctx, AV_LOG_ERROR, "Too few bits (%d) left\n", ret);
|
||||
}
|
||||
*last = 1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -638,7 +638,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
|
||||
|
||||
if ((v += v >> 9) < (1 << 8)) {
|
||||
dbits = nbits_table[v];
|
||||
result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
|
||||
*result += (dbits << 8) + wp_log2_table[(v << (9 - dbits)) & 0xff];
|
||||
} else {
|
||||
if (v < (1L << 16))
|
||||
dbits = nbits_table[v >> 8] + 8;
|
||||
@ -647,7 +647,7 @@ static uint32_t log2sample(uint32_t v, int limit, uint32_t *result)
|
||||
else
|
||||
dbits = nbits_table[v >> 24] + 24;
|
||||
|
||||
result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
|
||||
*result += dbits = (dbits << 8) + wp_log2_table[(v >> (dbits - 9)) & 0xff];
|
||||
|
||||
if (limit && dbits >= limit)
|
||||
return 1;
|
||||
@ -2876,10 +2876,11 @@ static int wavpack_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, s->block_samples * avctx->channels * 8)) < 0)
|
||||
buf_size = s->block_samples * avctx->channels * 8
|
||||
+ 200 /* for headers */;
|
||||
if ((ret = ff_alloc_packet2(avctx, avpkt, buf_size)) < 0)
|
||||
return ret;
|
||||
buf = avpkt->data;
|
||||
buf_size = avpkt->size;
|
||||
|
||||
for (s->ch_offset = 0; s->ch_offset < avctx->channels;) {
|
||||
set_samplerate(s);
|
||||
|
@ -1028,7 +1028,7 @@ static int apply_color_indexing_transform(WebPContext *s)
|
||||
ImageContext *img;
|
||||
ImageContext *pal;
|
||||
int i, x, y;
|
||||
uint8_t *p, *pi;
|
||||
uint8_t *p;
|
||||
|
||||
img = &s->image[IMAGE_ROLE_ARGB];
|
||||
pal = &s->image[IMAGE_ROLE_COLOR_INDEXING];
|
||||
@ -1066,11 +1066,11 @@ static int apply_color_indexing_transform(WebPContext *s)
|
||||
p = GET_PIXEL(img->frame, x, y);
|
||||
i = p[2];
|
||||
if (i >= pal->frame->width) {
|
||||
av_log(s->avctx, AV_LOG_ERROR, "invalid palette index %d\n", i);
|
||||
return AVERROR_INVALIDDATA;
|
||||
AV_WB32(p, 0x00000000);
|
||||
} else {
|
||||
const uint8_t *pi = GET_PIXEL(pal->frame, i, 0);
|
||||
AV_COPY32(p, pi);
|
||||
}
|
||||
pi = GET_PIXEL(pal->frame, i, 0);
|
||||
AV_COPY32(p, pi);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -342,7 +342,7 @@ QPEL_TABLE 10, 4, w, sse4
|
||||
|
||||
%macro LOOP_END 4
|
||||
lea %1q, [%1q+2*%2q] ; dst += dststride
|
||||
lea %3q, [%3q+ %4q] ; src += srcstride
|
||||
add %3q, %4q ; src += srcstride
|
||||
dec heightd ; cmp height
|
||||
jnz .loop ; height loop
|
||||
%endmacro
|
||||
|
@ -20,10 +20,10 @@
|
||||
;* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
;******************************************************************************
|
||||
|
||||
%if ARCH_X86_64
|
||||
|
||||
%include "libavutil/x86/x86util.asm"
|
||||
|
||||
%if ARCH_X86_64
|
||||
|
||||
SECTION_RODATA
|
||||
|
||||
cextern pb_3
|
||||
|
@ -681,7 +681,7 @@ static int pulse_write_frame(AVFormatContext *h, int stream_index,
|
||||
AVERROR(EINVAL) : 0;
|
||||
|
||||
pkt.data = (*frame)->data[0];
|
||||
pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * (*frame)->channels;
|
||||
pkt.size = (*frame)->nb_samples * av_get_bytes_per_sample((*frame)->format) * av_frame_get_channels(*frame);
|
||||
pkt.dts = (*frame)->pkt_dts;
|
||||
pkt.duration = av_frame_get_pkt_duration(*frame);
|
||||
return pulse_write_packet(h, &pkt);
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "avdevice.h"
|
||||
|
||||
typedef struct {
|
||||
AVClass *class;
|
||||
int fd;
|
||||
} V4L2Context;
|
||||
|
||||
|
@ -233,9 +233,9 @@ static void filter(SPPContext *p, uint8_t *dst, uint8_t *src,
|
||||
const int y1 = y + offset[i + count - 1][1];
|
||||
const int index = x1 + y1*linesize;
|
||||
p->pdsp.get_pixels(block, p->src + index, linesize);
|
||||
p->fdsp.fdct(block);
|
||||
p->requantize(block2, block, qp, p->idsp.idct_permutation);
|
||||
p->idsp.idct(block2);
|
||||
p->dct->fdct(block);
|
||||
p->requantize(block2, block, qp, p->dct->idct_permutation);
|
||||
p->dct->idct(block2);
|
||||
add_block(p->temp + index, linesize, block2);
|
||||
}
|
||||
}
|
||||
@ -378,11 +378,11 @@ static av_cold int init(AVFilterContext *ctx)
|
||||
SPPContext *spp = ctx->priv;
|
||||
|
||||
spp->avctx = avcodec_alloc_context3(NULL);
|
||||
if (!spp->avctx)
|
||||
spp->dct = avcodec_dct_alloc();
|
||||
if (!spp->avctx || !spp->dct)
|
||||
return AVERROR(ENOMEM);
|
||||
ff_idctdsp_init(&spp->idsp, spp->avctx);
|
||||
ff_fdctdsp_init(&spp->fdsp, spp->avctx);
|
||||
ff_pixblockdsp_init(&spp->pdsp, spp->avctx);
|
||||
avcodec_dct_init(spp->dct);
|
||||
spp->store_slice = store_slice_c;
|
||||
switch (spp->mode) {
|
||||
case MODE_HARD: spp->requantize = hardthresh_c; break;
|
||||
@ -403,6 +403,7 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
avcodec_close(spp->avctx);
|
||||
av_freep(&spp->avctx);
|
||||
}
|
||||
av_freep(&spp->dct);
|
||||
av_freep(&spp->non_b_qp_table);
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,7 @@
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/pixblockdsp.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
#include "libavcodec/fdctdsp.h"
|
||||
#include "libavcodec/avdct.h"
|
||||
#include "avfilter.h"
|
||||
|
||||
#define MAX_LEVEL 6 /* quality levels */
|
||||
@ -41,9 +40,8 @@ typedef struct {
|
||||
uint8_t *src;
|
||||
int16_t *temp;
|
||||
AVCodecContext *avctx;
|
||||
IDCTDSPContext idsp;
|
||||
FDCTDSPContext fdsp;
|
||||
PixblockDSPContext pdsp;
|
||||
AVDCT *dct;
|
||||
int8_t *non_b_qp_table;
|
||||
int non_b_qp_alloc_size;
|
||||
int use_bframe_qp;
|
||||
|
@ -55,8 +55,10 @@ static int ape_tag_read_field(AVFormatContext *s)
|
||||
av_log(s, AV_LOG_WARNING, "Invalid APE tag key '%s'.\n", key);
|
||||
return -1;
|
||||
}
|
||||
if (size >= UINT_MAX)
|
||||
return -1;
|
||||
if (size > INT32_MAX - FF_INPUT_BUFFER_PADDING_SIZE) {
|
||||
av_log(s, AV_LOG_ERROR, "APE tag size too large.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (flags & APE_TAG_FLAG_IS_BINARY) {
|
||||
uint8_t filename[1024];
|
||||
enum AVCodecID id;
|
||||
|
@ -72,30 +72,33 @@ static inline uint16_t dv_audio_12to16(uint16_t sample)
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is the dumbest implementation of all -- it simply looks at
|
||||
* a fixed offset and if pack isn't there -- fails. We might want
|
||||
* to have a fallback mechanism for complete search of missing packs.
|
||||
*/
|
||||
static const uint8_t *dv_extract_pack(uint8_t *frame, enum dv_pack_type t)
|
||||
{
|
||||
int offs;
|
||||
int c;
|
||||
|
||||
switch (t) {
|
||||
case dv_audio_source:
|
||||
offs = (80 * 6 + 80 * 16 * 3 + 3);
|
||||
break;
|
||||
case dv_audio_control:
|
||||
offs = (80 * 6 + 80 * 16 * 4 + 3);
|
||||
break;
|
||||
case dv_video_control:
|
||||
offs = (80 * 5 + 48 + 5);
|
||||
break;
|
||||
case dv_timecode:
|
||||
offs = (80*1 + 3 + 3);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
for (c = 0; c < 10; c++) {
|
||||
switch (t) {
|
||||
case dv_audio_source:
|
||||
if (c&1) offs = (80 * 6 + 80 * 16 * 0 + 3 + c*12000);
|
||||
else offs = (80 * 6 + 80 * 16 * 3 + 3 + c*12000);
|
||||
break;
|
||||
case dv_audio_control:
|
||||
if (c&1) offs = (80 * 6 + 80 * 16 * 1 + 3 + c*12000);
|
||||
else offs = (80 * 6 + 80 * 16 * 4 + 3 + c*12000);
|
||||
break;
|
||||
case dv_video_control:
|
||||
if (c&1) offs = (80 * 3 + 8 + c*12000);
|
||||
else offs = (80 * 5 + 48 + 5 + c*12000);
|
||||
break;
|
||||
case dv_timecode:
|
||||
offs = (80*1 + 3 + 3);
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
if (frame[offs] == t)
|
||||
break;
|
||||
}
|
||||
|
||||
return frame[offs] == t ? &frame[offs] : NULL;
|
||||
|
@ -666,6 +666,7 @@ static const AVClass imgname ## _class = {\
|
||||
};\
|
||||
AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\
|
||||
.name = AV_STRINGIFY(imgname) "_pipe",\
|
||||
.long_name = NULL_IF_CONFIG_SMALL("piped " AV_STRINGIFY(imgname) " sequence"),\
|
||||
.priv_data_size = sizeof(VideoDemuxData),\
|
||||
.read_probe = imgname ## _probe,\
|
||||
.read_header = ff_img_read_header,\
|
||||
|
@ -33,13 +33,15 @@ static int mpeg4video_probe(AVProbeData *probe_packet)
|
||||
|
||||
for(i=0; i<probe_packet->buf_size; i++){
|
||||
temp_buffer = (temp_buffer<<8) + probe_packet->buf[i];
|
||||
if ((temp_buffer & 0xffffff00) != 0x100)
|
||||
if (temp_buffer & 0xfffffe00)
|
||||
continue;
|
||||
if (temp_buffer < 2)
|
||||
continue;
|
||||
|
||||
if (temp_buffer == VOP_START_CODE) VOP++;
|
||||
else if (temp_buffer == VISUAL_OBJECT_START_CODE) VISO++;
|
||||
else if (temp_buffer < 0x120) VO++;
|
||||
else if (temp_buffer < 0x130) VOL++;
|
||||
else if (temp_buffer >= 0x100 && temp_buffer < 0x120) VO++;
|
||||
else if (temp_buffer >= 0x120 && temp_buffer < 0x130) VOL++;
|
||||
else if ( !(0x1AF < temp_buffer && temp_buffer < 0x1B7)
|
||||
&& !(0x1B9 < temp_buffer && temp_buffer < 0x1C4)) res++;
|
||||
}
|
||||
|
@ -2161,8 +2161,10 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
(AVRational) { 1, 1000000000 },
|
||||
chapters[i].start, chapters[i].end,
|
||||
chapters[i].title);
|
||||
av_dict_set(&chapters[i].chapter->metadata,
|
||||
"title", chapters[i].title, 0);
|
||||
if (chapters[i].chapter) {
|
||||
av_dict_set(&chapters[i].chapter->metadata,
|
||||
"title", chapters[i].title, 0);
|
||||
}
|
||||
max_start = chapters[i].start;
|
||||
}
|
||||
|
||||
|
@ -445,8 +445,21 @@ static int64_t mkv_write_cues(AVFormatContext *s, mkv_cues *cues, mkv_track *tra
|
||||
ebml_master cuepoint, track_positions;
|
||||
mkv_cuepoint *entry = &cues->entries[i];
|
||||
uint64_t pts = entry->pts;
|
||||
int ctp_nb = 0;
|
||||
|
||||
cuepoint = start_ebml_master(pb, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_SIZE(num_tracks));
|
||||
// Calculate the number of entries, so we know the element size
|
||||
for (j = 0; j < num_tracks; j++)
|
||||
tracks[j].has_cue = 0;
|
||||
for (j = 0; j < cues->num_entries - i && entry[j].pts == pts; j++) {
|
||||
int tracknum = entry[j].stream_idx;
|
||||
av_assert0(tracknum>=0 && tracknum<num_tracks);
|
||||
if (tracks[tracknum].has_cue && s->streams[tracknum]->codec->codec_type != AVMEDIA_TYPE_SUBTITLE)
|
||||
continue;
|
||||
tracks[tracknum].has_cue = 1;
|
||||
ctp_nb ++;
|
||||
}
|
||||
|
||||
cuepoint = start_ebml_master(pb, MATROSKA_ID_POINTENTRY, MAX_CUEPOINT_SIZE(ctp_nb));
|
||||
put_ebml_uint(pb, MATROSKA_ID_CUETIME, pts);
|
||||
|
||||
// put all the entries from different tracks that have the exact same
|
||||
|
@ -783,7 +783,7 @@ static int vobsub_read_header(AVFormatContext *s)
|
||||
|
||||
while (*p == ' ')
|
||||
p++;
|
||||
av_log(s, AV_LOG_DEBUG, "IDX stream[%d] name=%s\n", st->id, p);
|
||||
av_log(s, AV_LOG_DEBUG, "IDX stream[%d] name=%s\n", stream_id, p);
|
||||
av_strlcpy(alt, p, sizeof(alt));
|
||||
header_parsed = 1;
|
||||
|
||||
|
@ -506,6 +506,7 @@ static int analyze(const uint8_t *buf, int size, int packet_size, int *index)
|
||||
int stat[TS_MAX_PACKET_SIZE];
|
||||
int i;
|
||||
int best_score = 0;
|
||||
int best_score2 = 0;
|
||||
|
||||
memset(stat, 0, packet_size * sizeof(*stat));
|
||||
|
||||
@ -517,11 +518,13 @@ static int analyze(const uint8_t *buf, int size, int packet_size, int *index)
|
||||
best_score = stat[x];
|
||||
if (index)
|
||||
*index = x;
|
||||
} else if (stat[x] > best_score2) {
|
||||
best_score2 = stat[x];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return best_score;
|
||||
return best_score - best_score2;
|
||||
}
|
||||
|
||||
/* autodetect fec presence. Must have at least 1024 bytes */
|
||||
|
@ -817,7 +817,6 @@ retry:
|
||||
return psize;
|
||||
fail:
|
||||
av_free_packet(pkt);
|
||||
av_free(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
|
@ -209,11 +209,15 @@ int ff_put_wav_header(AVIOContext *pb, AVCodecContext *enc, int flags)
|
||||
void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
|
||||
const AVCodecTag *tags, int for_asf, int ignore_extradata)
|
||||
{
|
||||
int keep_height = enc->extradata_size >= 9 &&
|
||||
!memcmp(enc->extradata + enc->extradata_size - 9, "BottomUp", 9);
|
||||
int extradata_size = enc->extradata_size - 9*keep_height;
|
||||
|
||||
/* size */
|
||||
avio_wl32(pb, 40 + (ignore_extradata ? 0 : enc->extradata_size));
|
||||
avio_wl32(pb, 40 + (ignore_extradata ? 0 :extradata_size));
|
||||
avio_wl32(pb, enc->width);
|
||||
//We always store RGB TopDown
|
||||
avio_wl32(pb, enc->codec_tag ? enc->height : -enc->height);
|
||||
avio_wl32(pb, enc->codec_tag || keep_height ? enc->height : -enc->height);
|
||||
/* planes */
|
||||
avio_wl16(pb, 1);
|
||||
/* depth */
|
||||
@ -227,9 +231,9 @@ void ff_put_bmp_header(AVIOContext *pb, AVCodecContext *enc,
|
||||
avio_wl32(pb, 0);
|
||||
|
||||
if (!ignore_extradata) {
|
||||
avio_write(pb, enc->extradata, enc->extradata_size);
|
||||
avio_write(pb, enc->extradata, extradata_size);
|
||||
|
||||
if (!for_asf && enc->extradata_size & 1)
|
||||
if (!for_asf && extradata_size & 1)
|
||||
avio_w8(pb, 0);
|
||||
}
|
||||
}
|
||||
|
@ -684,7 +684,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
end_pts = seg->segment_count < seg->nb_times ?
|
||||
seg->times[seg->segment_count] : INT64_MAX;
|
||||
} else if (seg->frames) {
|
||||
start_frame = seg->segment_count <= seg->nb_frames ?
|
||||
start_frame = seg->segment_count < seg->nb_frames ?
|
||||
seg->frames[seg->segment_count] : INT_MAX;
|
||||
} else {
|
||||
if (seg->use_clocktime) {
|
||||
|
@ -289,6 +289,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
const int bmp_fmt = avio_r8(pb);
|
||||
const int width = avio_rl16(pb);
|
||||
const int height = avio_rl16(pb);
|
||||
int pix_fmt;
|
||||
|
||||
len -= 2+1+2+2;
|
||||
|
||||
@ -353,17 +354,21 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
avpriv_set_pts_info(vst, 64, 256, swf->frame_rate);
|
||||
st = vst;
|
||||
}
|
||||
st->codec->width = width;
|
||||
st->codec->height = height;
|
||||
|
||||
if ((res = av_new_packet(pkt, out_len - colormapsize * colormapbpp)) < 0)
|
||||
goto bitmap_end;
|
||||
if (!st->codec->width && !st->codec->height) {
|
||||
st->codec->width = width;
|
||||
st->codec->height = height;
|
||||
} else {
|
||||
ff_add_param_change(pkt, 0, 0, 0, width, height);
|
||||
}
|
||||
pkt->pos = pos;
|
||||
pkt->stream_index = st->index;
|
||||
|
||||
switch (bmp_fmt) {
|
||||
case 3:
|
||||
st->codec->pix_fmt = AV_PIX_FMT_PAL8;
|
||||
pix_fmt = AV_PIX_FMT_PAL8;
|
||||
for (i = 0; i < colormapsize; i++)
|
||||
if (alpha_bmp) colormap[i] = buf[3]<<24 | AV_RB24(buf + 4*i);
|
||||
else colormap[i] = 0xffU <<24 | AV_RB24(buf + 3*i);
|
||||
@ -375,14 +380,20 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
memcpy(pal, colormap, AVPALETTE_SIZE);
|
||||
break;
|
||||
case 4:
|
||||
st->codec->pix_fmt = AV_PIX_FMT_RGB555;
|
||||
pix_fmt = AV_PIX_FMT_RGB555;
|
||||
break;
|
||||
case 5:
|
||||
st->codec->pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
|
||||
pix_fmt = alpha_bmp ? AV_PIX_FMT_ARGB : AV_PIX_FMT_0RGB;
|
||||
break;
|
||||
default:
|
||||
av_assert0(0);
|
||||
}
|
||||
if (st->codec->pix_fmt != AV_PIX_FMT_NONE && st->codec->pix_fmt != pix_fmt) {
|
||||
av_log(s, AV_LOG_ERROR, "pixel format change unsupported\n");
|
||||
res = AVERROR_PATCHWELCOME;
|
||||
goto bitmap_end;
|
||||
}
|
||||
st->codec->pix_fmt = pix_fmt;
|
||||
|
||||
if (linesize * height > pkt->size) {
|
||||
res = AVERROR_INVALIDDATA;
|
||||
|
@ -467,7 +467,7 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
|
||||
if ((ret = av_copy_packet(&pkt2, pkt)) < 0 ||
|
||||
(ret = av_dup_packet(&pkt2))< 0)
|
||||
if (!ret_all) {
|
||||
ret = ret_all;
|
||||
ret_all = ret;
|
||||
continue;
|
||||
}
|
||||
tb = avf ->streams[s ]->time_base;
|
||||
|
@ -225,6 +225,10 @@ int av_parse_cpu_caps(unsigned *flags, const char *s)
|
||||
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
|
||||
{ "vfpv3", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFPV3 }, .unit = "flags" },
|
||||
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
|
||||
#elif ARCH_AARCH64
|
||||
{ "armv8", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_ARMV8 }, .unit = "flags" },
|
||||
{ "neon", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_NEON }, .unit = "flags" },
|
||||
{ "vfp", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = AV_CPU_FLAG_VFP }, .unit = "flags" },
|
||||
#endif
|
||||
{ NULL },
|
||||
};
|
||||
|
@ -631,7 +631,7 @@ int av_opt_set_channel_layout(void *obj, const char *name, int64_t cl, int searc
|
||||
"The value set by option '%s' is not a channel layout.\n", o->name);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
*(int *)(((int64_t *)target_obj) + o->offset) = cl;
|
||||
*(int64_t *)(((uint8_t *)target_obj) + o->offset) = cl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@
|
||||
"cpuid \n\t" \
|
||||
"xchg %%"REG_b", %%"REG_S \
|
||||
: "=a" (eax), "=S" (ebx), "=c" (ecx), "=d" (edx) \
|
||||
: "0" (index))
|
||||
: "0" (index), "2"(0))
|
||||
|
||||
#define xgetbv(index, eax, edx) \
|
||||
__asm__ (".byte 0x0f, 0x01, 0xd0" : "=a"(eax), "=d"(edx) : "c" (index))
|
||||
|
@ -19,6 +19,8 @@ test -n "$slot" || die "slot not specified"
|
||||
test -n "$repo" || die "repo not specified"
|
||||
test -d "$samples" || die "samples location not specified"
|
||||
|
||||
: ${branch:=master}
|
||||
|
||||
lock(){
|
||||
lock=$1/fate.lock
|
||||
(set -C; exec >$lock) 2>/dev/null || return
|
||||
@ -28,14 +30,14 @@ lock(){
|
||||
checkout(){
|
||||
case "$repo" in
|
||||
file:*|/*) src="${repo#file:}" ;;
|
||||
git:*) git clone --quiet "$repo" "$src" ;;
|
||||
git:*) git clone --quiet --branch "$branch" "$repo" "$src" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
update()(
|
||||
cd ${src} || return
|
||||
case "$repo" in
|
||||
git:*) git fetch --force && git reset --hard FETCH_HEAD ;;
|
||||
git:*) git fetch --force && git reset --hard "origin/$branch" ;;
|
||||
esac
|
||||
)
|
||||
|
||||
@ -82,7 +84,9 @@ clean(){
|
||||
report(){
|
||||
date=$(date -u +%Y%m%d%H%M%S)
|
||||
echo "fate:0:${date}:${slot}:${version}:$1:$2:${comment}" >report
|
||||
cat ${build}/config.fate ${build}/tests/data/fate/*.rep >>report
|
||||
# echo "fate:1:${date}:${slot}:${version}:$1:$2:${branch}:${comment}" >report
|
||||
cat ${build}/config.fate >>report
|
||||
cat ${build}/tests/data/fate/*.rep >>report || for i in ${build}/tests/data/fate/*.rep ; do cat "$i" >>report ; done
|
||||
test -n "$fate_recv" && $tar report *.log | gzip | $fate_recv
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
bda342503392d517955e1112def7b03a *./tests/data/lavf/lavf.mkv
|
||||
472671 ./tests/data/lavf/lavf.mkv
|
||||
bab98f5a04a9f7991fb960041c996478 *./tests/data/lavf/lavf.mkv
|
||||
472668 ./tests/data/lavf/lavf.mkv
|
||||
./tests/data/lavf/lavf.mkv CRC=0xec6c3c68
|
||||
c93950920d4ee57eb3ff5ba0cf0c8b19 *./tests/data/lavf/lavf.mkv
|
||||
320412 ./tests/data/lavf/lavf.mkv
|
||||
|
@ -33,6 +33,10 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/timer.h"
|
||||
|
||||
#ifndef AV_READ_TIME
|
||||
#define AV_READ_TIME(x) 0
|
||||
#endif
|
||||
|
||||
#if HAVE_UNISTD_H
|
||||
#include <unistd.h> /* for getopt */
|
||||
#endif
|
||||
|
@ -4,7 +4,11 @@
|
||||
|
||||
# check for git short hash
|
||||
if ! test "$revision"; then
|
||||
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
|
||||
if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
|
||||
revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
|
||||
else
|
||||
revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
|
||||
fi
|
||||
fi
|
||||
|
||||
# Shallow Git clones (--depth) do not have the N tag:
|
||||
|
Loading…
x
Reference in New Issue
Block a user