Compare commits
133 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f406bf3fa9 | |||
| 54bec22a6e | |||
| e1b2c93a23 | |||
| e529ff52a0 | |||
| fb7e76d1cf | |||
| 96047b3150 | |||
| 2545defeac | |||
| 2d97ad38ed | |||
| f6c628f029 | |||
| 3f743e3e4c | |||
| f2dbd64bde | |||
| 7bce659e18 | |||
| cb9379065f | |||
| 4261778dbd | |||
| ba88a6e4e4 | |||
| e0407a7bf7 | |||
| d575984dfc | |||
| 9ea1e82d68 | |||
| 5cd2cdf33f | |||
| a5a6f6fec3 | |||
| 88544e8ceb | |||
| f183eaa3ad | |||
| d773d7775a | |||
| f15f4cefd7 | |||
| 0ec75a04e5 | |||
| 34fb994d93 | |||
| acafd1814e | |||
| bb01956d67 | |||
| bc0c49b83e | |||
| 0008a87cb1 | |||
| 2aa6592338 | |||
| 2b14d98086 | |||
| a05f86ec10 | |||
| 9bdb254b98 | |||
| 358d1f6e01 | |||
| ea28034f5d | |||
| 6452b31599 | |||
| a14969253a | |||
| fab9a7be76 | |||
| 3a67865963 | |||
| 3fb754712c | |||
| e5294f407a | |||
| ed1ad2f5eb | |||
| e780c3daaf | |||
| 7f954ca502 | |||
| 8e9e57ed0c | |||
| 1bd6372cd3 | |||
| 40ffa99dfa | |||
| ff79f6b35a | |||
| e2a83d72da | |||
| 6c3985713b | |||
| 7d97cc8d87 | |||
| a56a9e65c6 | |||
| 428b629eb2 | |||
| 194d12345d | |||
| b3d8276d2d | |||
| c2eb668617 | |||
| c9c223ba00 | |||
| 9d0ff6436e | |||
| 02b7b125b5 | |||
| 5643668308 | |||
| 2d18e7f3ef | |||
| f1b5830182 | |||
| c588316555 | |||
| afd1f61944 | |||
| 16a9c5ea9e | |||
| 83fb31a76d | |||
| fc5b32877a | |||
| 10e023c4fa | |||
| 27a3a59428 | |||
| 8ab849cddc | |||
| 5191b00155 | |||
| 1131e7a1a4 | |||
| 26becbcd2a | |||
| 366cdd3548 | |||
| e3b08b3ad4 | |||
| fa16440659 | |||
| c36fd16aaa | |||
| 8c5897632a | |||
| b34fce9c54 | |||
| 742f9aa879 | |||
| 79041d92ee | |||
| 82cebc0e05 | |||
| 09abca6802 | |||
| 43d64829e6 | |||
| 4a479fd3e6 | |||
| 4f41717d01 | |||
| 6896dcbf5f | |||
| 14404170b9 | |||
| e9e42beed2 | |||
| abd6decd55 | |||
| 0385c824f1 | |||
| c4e764aa69 | |||
| 9d02e38d3f | |||
| 30cf47c6f0 | |||
| b45cd17d29 | |||
| 26b6d70c72 | |||
| 32919db4fb | |||
| 56f44c26f0 | |||
| fe87a40de6 | |||
| 0f6e309b97 | |||
| 96e13c9897 | |||
| e72c0a0466 | |||
| dfddefa13a | |||
| ce94955b3c | |||
| dde95268cc | |||
| d20ac551a8 | |||
| 352b0969e2 | |||
| b479b42b26 | |||
| 36cab9c408 | |||
| 34592d04fb | |||
| 544accc895 | |||
| f41622ecb4 | |||
| fc8eb4c1f9 | |||
| 02bae9f013 | |||
| 5cb2a1c3f0 | |||
| a221c9bd76 | |||
| b2583c2b62 | |||
| bd553941ae | |||
| e0aa76d38a | |||
| a014b9614e | |||
| 31c21d2f69 | |||
| 3cd1c8653b | |||
| 194485cfba | |||
| 81cfe39113 | |||
| ef0c503d37 | |||
| 1103aec1df | |||
| b40ab81d1f | |||
| 314f055c29 | |||
| 2c566744c4 | |||
| adad1ba5d8 | |||
| a80a7131d1 | |||
| 3ab63abbd4 |
@@ -13,7 +13,8 @@
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
// MA 02110-1301 USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA, or visit
|
||||
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
// MA 02110-1301 USA, or visit
|
||||
// http://www.gnu.org/copyleft/gpl.html .
|
||||
//
|
||||
// As a special exception, I give you permission to link to the
|
||||
|
||||
@@ -3386,7 +3386,7 @@ case "$arch" in
|
||||
tilegx|tile-gx)
|
||||
arch="tilegx"
|
||||
;;
|
||||
i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
|
||||
i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
|
||||
arch="x86"
|
||||
;;
|
||||
esac
|
||||
|
||||
+1
-1
@@ -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 = 2.2
|
||||
PROJECT_NUMBER = 2.2.3
|
||||
|
||||
# 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
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ AC-3 audio decoder.
|
||||
This decoder implements part of ATSC A/52:2010 and ETSI TS 102 366, as well as
|
||||
the undocumented RealAudio 3 (a.k.a. dnet).
|
||||
|
||||
@subsubsection AC-3 Decoder Options
|
||||
@subsection AC-3 Decoder Options
|
||||
|
||||
@table @option
|
||||
|
||||
|
||||
+1
-1
@@ -296,7 +296,7 @@ teletext packet PTS and DTS values untouched.
|
||||
|
||||
Raw video demuxer.
|
||||
|
||||
This demuxer allows to read raw video data. Since there is no header
|
||||
This demuxer allows one to read raw video data. Since there is no header
|
||||
specifying the assumed video parameters, the user must specify them
|
||||
in order to be able to decode the data correctly.
|
||||
|
||||
|
||||
+5
-5
@@ -807,7 +807,7 @@ while producing the worst quality.
|
||||
|
||||
@item reservoir
|
||||
Enable use of bit reservoir when set to 1. Default value is 1. LAME
|
||||
has this enabled by default, but can be overriden by use
|
||||
has this enabled by default, but can be overridden by use
|
||||
@option{--nores} option.
|
||||
|
||||
@item joint_stereo (@emph{-m j})
|
||||
@@ -1271,7 +1271,7 @@ Requires the presence of the libtheora headers and library during
|
||||
configuration. You need to explicitly configure the build with
|
||||
@code{--enable-libtheora}.
|
||||
|
||||
For more informations about the libtheora project see
|
||||
For more information about the libtheora project see
|
||||
@url{http://www.theora.org/}.
|
||||
|
||||
@subsection Options
|
||||
@@ -1525,7 +1525,7 @@ for detail retention (adaptive quantization, psy-RD, psy-trellis).
|
||||
Many libx264 encoder options are mapped to FFmpeg global codec
|
||||
options, while unique encoder options are provided through private
|
||||
options. Additionally the @option{x264opts} and @option{x264-params}
|
||||
private options allows to pass a list of key=value tuples as accepted
|
||||
private options allows one to pass a list of key=value tuples as accepted
|
||||
by the libx264 @code{x264_param_parse} function.
|
||||
|
||||
The x264 project website is at
|
||||
@@ -1853,7 +1853,7 @@ Override the x264 configuration using a :-separated list of key=value
|
||||
parameters.
|
||||
|
||||
This option is functionally the same as the @option{x264opts}, but is
|
||||
duplicated for compability with the Libav fork.
|
||||
duplicated for compatibility with the Libav fork.
|
||||
|
||||
For example to specify libx264 encoding options with @command{ffmpeg}:
|
||||
@example
|
||||
@@ -2047,7 +2047,7 @@ Set physical density of pixels, in dots per meter, unset by default
|
||||
Apple ProRes encoder.
|
||||
|
||||
FFmpeg contains 2 ProRes encoders, the prores-aw and prores-ks encoder.
|
||||
The used encoder can be choosen with the @code{-vcodec} option.
|
||||
The used encoder can be chosen with the @code{-vcodec} option.
|
||||
|
||||
@subsection Private Options for prores-ks
|
||||
|
||||
|
||||
@@ -119,8 +119,10 @@ int main(int argc, char *argv[])
|
||||
end:
|
||||
avformat_close_input(&fmt_ctx);
|
||||
/* note: the internal buffer could have changed, and be != avio_ctx_buffer */
|
||||
av_freep(&avio_ctx->buffer);
|
||||
av_freep(&avio_ctx);
|
||||
if (avio_ctx) {
|
||||
av_freep(&avio_ctx->buffer);
|
||||
av_freep(&avio_ctx);
|
||||
}
|
||||
av_file_unmap(buffer, buffer_size);
|
||||
|
||||
if (ret < 0) {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
The FFmpeg resampler provides a high-level interface to the
|
||||
libswresample library audio resampling utilities. In particular it
|
||||
allows to perform audio resampling, audio channel layout rematrixing,
|
||||
allows one to perform audio resampling, audio channel layout rematrixing,
|
||||
and convert audio format and packing layout.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
@c man begin DESCRIPTION
|
||||
|
||||
The FFmpeg rescaler provides a high-level interface to the libswscale
|
||||
library image conversion utilities. In particular it allows to perform
|
||||
library image conversion utilities. In particular it allows one to perform
|
||||
image rescaling and pixel format conversion.
|
||||
|
||||
@c man end DESCRIPTION
|
||||
|
||||
+1
-1
@@ -111,7 +111,7 @@ must be configured in the stream configuration. They are sent to
|
||||
the @command{ffmpeg} encoders.
|
||||
|
||||
The @command{ffmpeg} @option{override_ffserver} commandline option
|
||||
allows to override the encoding parameters set by the server.
|
||||
allows one to override the encoding parameters set by the server.
|
||||
|
||||
Multiple streams can be connected to the same feed.
|
||||
|
||||
|
||||
+9
-9
@@ -172,7 +172,7 @@ terminated when the next special character (belonging to the set
|
||||
|
||||
The name and arguments of the filter are optionally preceded and
|
||||
followed by a list of link labels.
|
||||
A link label allows to name a link and associate it to a filter output
|
||||
A link label allows one to name a link and associate it to a filter output
|
||||
or input pad. The preceding labels @var{in_link_1}
|
||||
... @var{in_link_N}, are associated to the filter input pads,
|
||||
the following labels @var{out_link_1} ... @var{out_link_M}, are
|
||||
@@ -3921,7 +3921,7 @@ The high threshold selects the "strong" edge pixels, which are then
|
||||
connected through 8-connectivity with the "weak" edge pixels selected
|
||||
by the low threshold.
|
||||
|
||||
@var{low} and @var{high} threshold values must be choosen in the range
|
||||
@var{low} and @var{high} threshold values must be chosen in the range
|
||||
[0,1], and @var{low} should be lesser or equal to @var{high}.
|
||||
|
||||
Default value for @var{low} is @code{20/255}, and default value for @var{high}
|
||||
@@ -5238,7 +5238,7 @@ Set progressive threshold.
|
||||
|
||||
Deinterleave or interleave fields.
|
||||
|
||||
This filter allows to process interlaced images fields without
|
||||
This filter allows one to process interlaced images fields without
|
||||
deinterlacing them. Deinterleaving splits the input frame into 2
|
||||
fields (so called half pictures). Odd lines are moved to the top
|
||||
half of the output image, even lines to the bottom half.
|
||||
@@ -6860,7 +6860,7 @@ rotate=A*sin(2*PI/T*t)
|
||||
@end example
|
||||
|
||||
@item
|
||||
Rotate the video, output size is choosen so that the whole rotating
|
||||
Rotate the video, output size is chosen so that the whole rotating
|
||||
input video is always completely contained in the output:
|
||||
@example
|
||||
rotate='2*PI*t:ow=hypot(iw,ih):oh=ow'
|
||||
@@ -6983,7 +6983,7 @@ Default value is @samp{0}.
|
||||
@item flags
|
||||
Set libswscale scaling flags. See
|
||||
@ref{sws_flags,,the ffmpeg-scaler manual,ffmpeg-scaler} for the
|
||||
complete list of values. If not explictly specified the filter applies
|
||||
complete list of values. If not explicitly specified the filter applies
|
||||
the default flags.
|
||||
|
||||
@item size, s
|
||||
@@ -7797,7 +7797,7 @@ Produce 8x8 PNG tiles of all keyframes (@option{-skip_frame nokey}) in a movie:
|
||||
ffmpeg -skip_frame nokey -i file.avi -vf 'scale=128:72,tile=8x8' -an -vsync 0 keyframes%03d.png
|
||||
@end example
|
||||
The @option{-vsync 0} is necessary to prevent @command{ffmpeg} from
|
||||
duplicating each output frame to accomodate the originally detected frame
|
||||
duplicating each output frame to accommodate the originally detected frame
|
||||
rate.
|
||||
|
||||
@item
|
||||
@@ -8394,7 +8394,7 @@ Set dithering to reduce the circular banding effects. Default is @code{1}
|
||||
(enabled).
|
||||
|
||||
@item aspect
|
||||
Set vignette aspect. This setting allows to adjust the shape of the vignette.
|
||||
Set vignette aspect. This setting allows one to adjust the shape of the vignette.
|
||||
Setting this value to the SAR of the input will make a rectangular vignetting
|
||||
following the dimensions of the video.
|
||||
|
||||
@@ -8903,7 +8903,7 @@ horizontally, vertically, or diagonally adjacent.
|
||||
|
||||
At each interaction the grid evolves according to the adopted rule,
|
||||
which specifies the number of neighbor alive cells which will make a
|
||||
cell stay alive or born. The @option{rule} option allows to specify
|
||||
cell stay alive or born. The @option{rule} option allows one to specify
|
||||
the rule to adopt.
|
||||
|
||||
This source accepts the following options:
|
||||
@@ -10323,7 +10323,7 @@ Note that when the movie is looped the source timestamps are not
|
||||
changed, so it will generate non monotonically increasing timestamps.
|
||||
@end table
|
||||
|
||||
This filter allows to overlay a second video on top of main input of
|
||||
This filter allows one to overlay a second video on top of main input of
|
||||
a filtergraph as shown in this graph:
|
||||
@example
|
||||
input -----------> deltapts0 --> overlay --> output
|
||||
|
||||
+1
-1
@@ -299,7 +299,7 @@ the current branch history.
|
||||
git commit --amend
|
||||
@end example
|
||||
|
||||
allows to amend the last commit details quickly.
|
||||
allows one to amend the last commit details quickly.
|
||||
|
||||
@example
|
||||
git rebase -i origin/master
|
||||
|
||||
+3
-3
@@ -409,7 +409,7 @@ OpenAL is part of Core Audio, the official Mac OS X Audio interface.
|
||||
See @url{http://developer.apple.com/technologies/mac/audio-and-video.html}
|
||||
@end table
|
||||
|
||||
This device allows to capture from an audio input device handled
|
||||
This device allows one to capture from an audio input device handled
|
||||
through OpenAL.
|
||||
|
||||
You need to specify the name of the device to capture in the provided
|
||||
@@ -617,7 +617,7 @@ Select the pixel format (only valid for raw video input).
|
||||
|
||||
@item input_format
|
||||
Set the preferred pixel format (for raw video) or a codec name.
|
||||
This option allows to select the input format, when several are
|
||||
This option allows one to select the input format, when several are
|
||||
available.
|
||||
|
||||
@item framerate
|
||||
@@ -678,7 +678,7 @@ other filename will be interpreted as device number 0.
|
||||
|
||||
X11 video input device.
|
||||
|
||||
This device allows to capture a region of an X11 display.
|
||||
This device allows one to capture a region of an X11 display.
|
||||
|
||||
The filename passed as input has the syntax:
|
||||
@example
|
||||
|
||||
+1
-1
@@ -758,7 +758,7 @@ The segment muxer supports the following options:
|
||||
@table @option
|
||||
@item reference_stream @var{specifier}
|
||||
Set the reference stream, as specified by the string @var{specifier}.
|
||||
If @var{specifier} is set to @code{auto}, the reference is choosen
|
||||
If @var{specifier} is set to @code{auto}, the reference is chosen
|
||||
automatically. Otherwise it must be a stream specifier (see the ``Stream
|
||||
specifiers'' chapter in the ffmpeg manual) which specifies the
|
||||
reference stream. The default value is @code{auto}.
|
||||
|
||||
+4
-4
@@ -42,7 +42,7 @@ ffmpeg -i INPUT -f alsa hw:1,7
|
||||
|
||||
CACA output device.
|
||||
|
||||
This output device allows to show a video stream in CACA window.
|
||||
This output device allows one to show a video stream in CACA window.
|
||||
Only one CACA window is allowed per application, so you can
|
||||
have only one instance of this output device in an application.
|
||||
|
||||
@@ -216,7 +216,7 @@ OpenGL output device.
|
||||
|
||||
To enable this output device you need to configure FFmpeg with @code{--enable-opengl}.
|
||||
|
||||
Device allows to render to OpenGL context.
|
||||
This output device allows one to render to OpenGL context.
|
||||
Context may be provided by application or default SDL window is created.
|
||||
|
||||
When device renders to external context, application must implement handlers for following messages:
|
||||
@@ -302,7 +302,7 @@ ffmpeg -i INPUT -f pulse "stream name"
|
||||
|
||||
SDL (Simple DirectMedia Layer) output device.
|
||||
|
||||
This output device allows to show a video stream in an SDL
|
||||
This output device allows one to show a video stream in an SDL
|
||||
window. Only one SDL window is allowed per application, so you can
|
||||
have only one instance of this output device in an application.
|
||||
|
||||
@@ -361,7 +361,7 @@ sndio audio output device.
|
||||
|
||||
XV (XVideo) output device.
|
||||
|
||||
This output device allows to show a video stream in a X Window System
|
||||
This output device allows one to show a video stream in a X Window System
|
||||
window.
|
||||
|
||||
@subsection Options
|
||||
|
||||
+2
-2
@@ -960,7 +960,7 @@ used as master salt.
|
||||
|
||||
@section tcp
|
||||
|
||||
Trasmission Control Protocol.
|
||||
Transmission Control Protocol.
|
||||
|
||||
The required syntax for a TCP url is:
|
||||
@example
|
||||
@@ -1066,7 +1066,7 @@ udp://@var{hostname}:@var{port}[?@var{options}]
|
||||
@var{options} contains a list of &-separated options of the form @var{key}=@var{val}.
|
||||
|
||||
In case threading is enabled on the system, a circular buffer is used
|
||||
to store the incoming data, which allows to reduce loss of data due to
|
||||
to store the incoming data, which allows one to reduce loss of data due to
|
||||
UDP socket buffer overruns. The @var{fifo_size} and
|
||||
@var{overrun_nonfatal} options are related to this buffer.
|
||||
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ Select nearest neighbor rescaling algorithm.
|
||||
@item area
|
||||
Select averaging area rescaling algorithm.
|
||||
|
||||
@item bicubiclin
|
||||
@item bicublin
|
||||
Select bicubic scaling algorithm for the luma component, bilinear for
|
||||
chroma components.
|
||||
|
||||
|
||||
+1
-1
@@ -1056,7 +1056,7 @@ which can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_de
|
||||
@item device_idx
|
||||
Select the index of the device used to run OpenCL code.
|
||||
|
||||
The specifed index must be one of the indexes in the device list which
|
||||
The specified index must be one of the indexes in the device list which
|
||||
can be obtained with @code{ffmpeg -opencl_bench} or @code{av_opencl_get_device_list()}.
|
||||
|
||||
@end table
|
||||
|
||||
@@ -514,6 +514,8 @@ static void ffmpeg_cleanup(int ret)
|
||||
if (received_sigterm) {
|
||||
av_log(NULL, AV_LOG_INFO, "Received signal %d: terminating.\n",
|
||||
(int) received_sigterm);
|
||||
} else if (ret) {
|
||||
av_log(NULL, AV_LOG_INFO, "Conversion failed!\n");
|
||||
}
|
||||
term_exit();
|
||||
}
|
||||
|
||||
+6
-3
@@ -44,12 +44,15 @@ enum AVPixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum AVPixelFo
|
||||
const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(target);
|
||||
int has_alpha = desc ? desc->nb_components % 2 == 0 : 0;
|
||||
enum AVPixelFormat best= AV_PIX_FMT_NONE;
|
||||
const enum AVPixelFormat mjpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
const enum AVPixelFormat ljpeg_formats[] = { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
|
||||
if (st->codec->strict_std_compliance <= FF_COMPLIANCE_UNOFFICIAL) {
|
||||
if (st->codec->codec_id == AV_CODEC_ID_MJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE };
|
||||
p = mjpeg_formats;
|
||||
} else if (st->codec->codec_id == AV_CODEC_ID_LJPEG) {
|
||||
p = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUV420P,
|
||||
AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE };
|
||||
p =ljpeg_formats;
|
||||
}
|
||||
}
|
||||
for (; *p != AV_PIX_FMT_NONE; p++) {
|
||||
|
||||
@@ -191,6 +191,7 @@ static const char unit_hertz_str[] = "Hz" ;
|
||||
static const char unit_byte_str[] = "byte" ;
|
||||
static const char unit_bit_per_second_str[] = "bit/s";
|
||||
|
||||
static int nb_streams;
|
||||
static uint64_t *nb_streams_packets;
|
||||
static uint64_t *nb_streams_frames;
|
||||
static int *selected_streams;
|
||||
@@ -246,6 +247,7 @@ static char *value_string(char *buf, int buf_size, struct unit_value uv)
|
||||
vald /= pow(10, index * 3);
|
||||
prefix_string = decimal_unit_prefixes[index];
|
||||
}
|
||||
vali = vald;
|
||||
}
|
||||
|
||||
if (show_float || (use_value_prefix && vald != (long long int)vald))
|
||||
@@ -336,7 +338,7 @@ static const AVOption writer_options[] = {
|
||||
{ "replace", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_REPLACE}, .unit = "sv" },
|
||||
{ "fail", NULL, 0, AV_OPT_TYPE_CONST, {.i64 = WRITER_STRING_VALIDATION_FAIL}, .unit = "sv" },
|
||||
{ "string_validation_replacement", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
|
||||
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str=""}},
|
||||
{ "svr", "set string validation replacement string", OFFSET(string_validation_replacement), AV_OPT_TYPE_STRING, {.str="\xEF\xBF\xBD"}},
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
@@ -1631,6 +1633,14 @@ static void writer_register_all(void)
|
||||
#define print_section_header(s) writer_print_section_header(w, s)
|
||||
#define print_section_footer(s) writer_print_section_footer(w, s)
|
||||
|
||||
#define REALLOCZ_ARRAY_STREAM(ptr, cur_n, new_n) \
|
||||
{ \
|
||||
ret = av_reallocp_array(&(ptr), (new_n), sizeof(*(ptr))); \
|
||||
if (ret < 0) \
|
||||
goto end; \
|
||||
memset( (ptr) + (cur_n), 0, ((new_n) - (cur_n)) * sizeof(*(ptr)) ); \
|
||||
}
|
||||
|
||||
static inline int show_tags(WriterContext *w, AVDictionary *tags, int section_id)
|
||||
{
|
||||
AVDictionaryEntry *tag = NULL;
|
||||
@@ -1892,6 +1902,12 @@ static int read_interval_packets(WriterContext *w, AVFormatContext *fmt_ctx,
|
||||
goto end;
|
||||
}
|
||||
while (!av_read_frame(fmt_ctx, &pkt)) {
|
||||
if (fmt_ctx->nb_streams > nb_streams) {
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_frames, nb_streams, fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_packets, nb_streams, fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(selected_streams, nb_streams, fmt_ctx->nb_streams);
|
||||
nb_streams = fmt_ctx->nb_streams;
|
||||
}
|
||||
if (selected_streams[pkt.stream_index]) {
|
||||
AVRational tb = fmt_ctx->streams[pkt.stream_index]->time_base;
|
||||
|
||||
@@ -2366,9 +2382,10 @@ static int probe_file(WriterContext *wctx, const char *filename)
|
||||
|
||||
#define CHECK_END if (ret < 0) goto end
|
||||
|
||||
nb_streams_frames = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_frames));
|
||||
nb_streams_packets = av_calloc(fmt_ctx->nb_streams, sizeof(*nb_streams_packets));
|
||||
selected_streams = av_calloc(fmt_ctx->nb_streams, sizeof(*selected_streams));
|
||||
nb_streams = fmt_ctx->nb_streams;
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_frames,0,fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(nb_streams_packets,0,fmt_ctx->nb_streams);
|
||||
REALLOCZ_ARRAY_STREAM(selected_streams,0,fmt_ctx->nb_streams);
|
||||
|
||||
for (i = 0; i < fmt_ctx->nb_streams; i++) {
|
||||
if (stream_specifier) {
|
||||
|
||||
+1
-1
@@ -81,7 +81,7 @@ enum BandType {
|
||||
INTENSITY_BT = 15, ///< Scalefactor data are intensity stereo positions.
|
||||
};
|
||||
|
||||
#define IS_CODEBOOK_UNSIGNED(x) ((x - 1) & 10)
|
||||
#define IS_CODEBOOK_UNSIGNED(x) (((x) - 1) & 10)
|
||||
|
||||
enum ChannelPosition {
|
||||
AAC_CHANNEL_OFF = 0,
|
||||
|
||||
+19
-7
@@ -1370,7 +1370,7 @@ static int dca_subsubframe(DCAContext *s, int base_channel, int block_index)
|
||||
* Decode VQ encoded high frequencies
|
||||
*/
|
||||
if (s->subband_activity[k] > s->vq_start_subband[k]) {
|
||||
if (!s->debug_flag & 0x01) {
|
||||
if (!(s->debug_flag & 0x01)) {
|
||||
av_log(s->avctx, AV_LOG_DEBUG,
|
||||
"Stream with high frequencies VQ coding\n");
|
||||
s->debug_flag |= 0x01;
|
||||
@@ -2173,7 +2173,7 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (s->core_downmix && (s->core_downmix_amode == DCA_STEREO ||
|
||||
s->core_downmix_amode == DCA_STEREO_TOTAL)) {
|
||||
int sign, code;
|
||||
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
|
||||
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
|
||||
sign = s->core_downmix_codes[i][0] & 0x100 ? 1 : -1;
|
||||
code = s->core_downmix_codes[i][0] & 0x0FF;
|
||||
s->downmix_coef[i][0] = (!code ? 0.0f :
|
||||
@@ -2191,19 +2191,19 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
|
||||
"Invalid channel mode %d\n", am);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
if (s->prim_channels + !!s->lfe >
|
||||
if (num_core_channels + !!s->lfe >
|
||||
FF_ARRAY_ELEMS(dca_default_coeffs[0])) {
|
||||
avpriv_request_sample(s->avctx, "Downmixing %d channels",
|
||||
s->prim_channels + !!s->lfe);
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
|
||||
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
|
||||
s->downmix_coef[i][0] = dca_default_coeffs[am][i][0];
|
||||
s->downmix_coef[i][1] = dca_default_coeffs[am][i][1];
|
||||
}
|
||||
}
|
||||
av_dlog(s->avctx, "Stereo downmix coeffs:\n");
|
||||
for (i = 0; i < s->prim_channels + !!s->lfe; i++) {
|
||||
for (i = 0; i < num_core_channels + !!s->lfe; i++) {
|
||||
av_dlog(s->avctx, "L, input channel %d = %f\n", i,
|
||||
s->downmix_coef[i][0]);
|
||||
av_dlog(s->avctx, "R, input channel %d = %f\n", i,
|
||||
@@ -2329,6 +2329,17 @@ static int dca_decode_frame(AVCodecContext *avctx, void *data,
|
||||
{ /* xxx should also do MA extensions */
|
||||
if (s->amode < 16) {
|
||||
avctx->channel_layout = dca_core_channel_layout[s->amode];
|
||||
|
||||
if (s->prim_channels + !!s->lfe > 2 &&
|
||||
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
|
||||
/*
|
||||
* Neither the core's auxiliary data nor our default tables contain
|
||||
* downmix coefficients for the additional channel coded in the XCh
|
||||
* extension, so when we're doing a Stereo downmix, don't decode it.
|
||||
*/
|
||||
s->xch_disable = 1;
|
||||
}
|
||||
|
||||
#if FF_API_REQUEST_CHANNELS
|
||||
FF_DISABLE_DEPRECATION_WARNINGS
|
||||
if (s->xch_present && !s->xch_disable &&
|
||||
@@ -2366,7 +2377,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (s->prim_channels + !!s->lfe > 2 &&
|
||||
if (num_core_channels + !!s->lfe > 2 &&
|
||||
avctx->request_channel_layout == AV_CH_LAYOUT_STEREO) {
|
||||
channels = 2;
|
||||
s->output = s->prim_channels == 2 ? s->amode : DCA_STEREO;
|
||||
@@ -2415,7 +2426,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
* masks in some sense -- unfortunately some channels could overlap */
|
||||
if (av_popcount(channel_mask) != av_popcount(channel_layout)) {
|
||||
av_log(avctx, AV_LOG_DEBUG,
|
||||
"DTS-XXCH: Inconsistant avcodec/dts channel layouts\n");
|
||||
"DTS-XXCH: Inconsistent avcodec/dts channel layouts\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
@@ -2433,6 +2444,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
s->xxch_order_tab[j++] = posn;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
s->lfe_index = av_popcount(channel_layout & (AV_CH_LOW_FREQUENCY-1));
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#ifndef AVCODEC_DIRAC_ARITH_H
|
||||
#define AVCODEC_DIRAC_ARITH_H
|
||||
|
||||
#include "libavutil/x86/asm.h"
|
||||
#include "bytestream.h"
|
||||
#include "get_bits.h"
|
||||
|
||||
@@ -134,7 +135,7 @@ static inline int dirac_get_arith_bit(DiracArith *c, int ctx)
|
||||
|
||||
range_times_prob = (c->range * prob_zero) >> 16;
|
||||
|
||||
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM
|
||||
#if HAVE_FAST_CMOV && HAVE_INLINE_ASM && HAVE_6REGS
|
||||
low -= range_times_prob << 16;
|
||||
range -= range_times_prob;
|
||||
bit = 0;
|
||||
|
||||
+39
-12
@@ -201,6 +201,7 @@ typedef struct DiracContext {
|
||||
|
||||
uint16_t *mctmp; /* buffer holding the MC data multipled by OBMC weights */
|
||||
uint8_t *mcscratch;
|
||||
int buffer_stride;
|
||||
|
||||
DECLARE_ALIGNED(16, uint8_t, obmc_weight)[3][MAX_BLOCKSIZE*MAX_BLOCKSIZE];
|
||||
|
||||
@@ -343,22 +344,44 @@ static int alloc_sequence_buffers(DiracContext *s)
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
|
||||
w = s->source.width;
|
||||
h = s->source.height;
|
||||
|
||||
/* fixme: allocate using real stride here */
|
||||
s->sbsplit = av_malloc(sbwidth * sbheight);
|
||||
s->blmotion = av_malloc(sbwidth * sbheight * 16 * sizeof(*s->blmotion));
|
||||
s->edge_emu_buffer_base = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
s->sbsplit = av_malloc_array(sbwidth, sbheight);
|
||||
s->blmotion = av_malloc_array(sbwidth, sbheight * 16 * sizeof(*s->blmotion));
|
||||
|
||||
s->mctmp = av_malloc((w+64+MAX_BLOCKSIZE) * (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc((w+64)*MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->sbsplit || !s->blmotion || !s->mctmp || !s->mcscratch)
|
||||
if (!s->sbsplit || !s->blmotion)
|
||||
return AVERROR(ENOMEM);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int alloc_buffers(DiracContext *s, int stride)
|
||||
{
|
||||
int w = s->source.width;
|
||||
int h = s->source.height;
|
||||
|
||||
av_assert0(stride >= w);
|
||||
stride += 64;
|
||||
|
||||
if (s->buffer_stride >= stride)
|
||||
return 0;
|
||||
s->buffer_stride = 0;
|
||||
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
memset(s->edge_emu_buffer, 0, sizeof(s->edge_emu_buffer));
|
||||
av_freep(&s->mctmp);
|
||||
av_freep(&s->mcscratch);
|
||||
|
||||
s->edge_emu_buffer_base = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
s->mctmp = av_malloc_array((stride+MAX_BLOCKSIZE), (h+MAX_BLOCKSIZE) * sizeof(*s->mctmp));
|
||||
s->mcscratch = av_malloc_array(stride, MAX_BLOCKSIZE);
|
||||
|
||||
if (!s->edge_emu_buffer_base || !s->mctmp || !s->mcscratch)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
s->buffer_stride = stride;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_sequence_buffers(DiracContext *s)
|
||||
{
|
||||
int i, j, k;
|
||||
@@ -382,6 +405,7 @@ static void free_sequence_buffers(DiracContext *s)
|
||||
av_freep(&s->plane[i].idwt_tmp);
|
||||
}
|
||||
|
||||
s->buffer_stride = 0;
|
||||
av_freep(&s->sbsplit);
|
||||
av_freep(&s->blmotion);
|
||||
av_freep(&s->edge_emu_buffer_base);
|
||||
@@ -1355,8 +1379,8 @@ static int mc_subpel(DiracContext *s, DiracBlock *block, const uint8_t *src[5],
|
||||
motion_y >>= s->chroma_y_shift;
|
||||
}
|
||||
|
||||
mx = motion_x & ~(-1 << s->mv_precision);
|
||||
my = motion_y & ~(-1 << s->mv_precision);
|
||||
mx = motion_x & ~(-1U << s->mv_precision);
|
||||
my = motion_y & ~(-1U << s->mv_precision);
|
||||
motion_x >>= s->mv_precision;
|
||||
motion_y >>= s->mv_precision;
|
||||
/* normalize subpel coordinates to epel */
|
||||
@@ -1854,6 +1878,9 @@ static int dirac_decode_data_unit(AVCodecContext *avctx, const uint8_t *buf, int
|
||||
s->plane[1].stride = pic->avframe->linesize[1];
|
||||
s->plane[2].stride = pic->avframe->linesize[2];
|
||||
|
||||
if (alloc_buffers(s, FFMAX3(FFABS(s->plane[0].stride), FFABS(s->plane[1].stride), FFABS(s->plane[2].stride))) < 0)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
/* [DIRAC_STD] 11.1 Picture parse. picture_parse() */
|
||||
if (dirac_decode_picture_header(s))
|
||||
return -1;
|
||||
|
||||
+2
-2
@@ -246,8 +246,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
|
||||
ctx->slice_data[slice].y_off = y_off;
|
||||
}
|
||||
|
||||
if (ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
|
||||
NULL, nslices, sizeof(ctx->slice_data[0])) < 0)
|
||||
if ((ret = avctx->execute(avctx, fic_decode_slice, ctx->slice_data,
|
||||
NULL, nslices, sizeof(ctx->slice_data[0]))) < 0)
|
||||
return ret;
|
||||
|
||||
skip:
|
||||
|
||||
+2
-1
@@ -2285,7 +2285,8 @@ static int pack_bitstream(G723_1_Context *p, unsigned char *frame, int size)
|
||||
if (p->cur_rate == RATE_6300) {
|
||||
info_bits = 0;
|
||||
put_bits(&pb, 2, info_bits);
|
||||
}
|
||||
}else
|
||||
av_assert0(0);
|
||||
|
||||
put_bits(&pb, 8, p->lsp_index[2]);
|
||||
put_bits(&pb, 8, p->lsp_index[1]);
|
||||
|
||||
@@ -58,7 +58,7 @@ int main(void)
|
||||
}
|
||||
}
|
||||
|
||||
#define EXTEND(i) (i << 3 | i & 7)
|
||||
#define EXTEND(i) ((i) << 3 | (i) & 7)
|
||||
init_put_bits(&pb, temp, SIZE);
|
||||
for (i = 0; i < COUNT; i++)
|
||||
set_ue_golomb(&pb, EXTEND(i));
|
||||
|
||||
+2
-2
@@ -219,9 +219,9 @@ static inline int get_se_golomb_long(GetBitContext *gb)
|
||||
unsigned int buf = get_ue_golomb_long(gb);
|
||||
|
||||
if (buf & 1)
|
||||
buf = -(buf >> 1);
|
||||
buf = (buf + 1) >> 1;
|
||||
else
|
||||
buf = (buf >> 1);
|
||||
buf = -(buf >> 1);
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
@@ -1813,6 +1813,7 @@ static int decode_update_thread_context(AVCodecContext *dst,
|
||||
memset(&h->mb, 0, sizeof(h->mb));
|
||||
memset(&h->mb_luma_dc, 0, sizeof(h->mb_luma_dc));
|
||||
memset(&h->mb_padding, 0, sizeof(h->mb_padding));
|
||||
memset(&h->cur_pic, 0, sizeof(h->cur_pic));
|
||||
|
||||
h->avctx = dst;
|
||||
h->DPB = NULL;
|
||||
|
||||
+8
-8
@@ -61,10 +61,10 @@
|
||||
#define MAX_SLICES 16
|
||||
|
||||
#ifdef ALLOW_INTERLACE
|
||||
#define MB_MBAFF(h) h->mb_mbaff
|
||||
#define MB_FIELD(h) h->mb_field_decoding_flag
|
||||
#define FRAME_MBAFF(h) h->mb_aff_frame
|
||||
#define FIELD_PICTURE(h) (h->picture_structure != PICT_FRAME)
|
||||
#define MB_MBAFF(h) (h)->mb_mbaff
|
||||
#define MB_FIELD(h) (h)->mb_field_decoding_flag
|
||||
#define FRAME_MBAFF(h) (h)->mb_aff_frame
|
||||
#define FIELD_PICTURE(h) ((h)->picture_structure != PICT_FRAME)
|
||||
#define LEFT_MBS 2
|
||||
#define LTOP 0
|
||||
#define LBOT 1
|
||||
@@ -84,12 +84,12 @@
|
||||
#define FIELD_OR_MBAFF_PICTURE(h) (FRAME_MBAFF(h) || FIELD_PICTURE(h))
|
||||
|
||||
#ifndef CABAC
|
||||
#define CABAC(h) h->pps.cabac
|
||||
#define CABAC(h) (h)->pps.cabac
|
||||
#endif
|
||||
|
||||
#define CHROMA(h) (h->sps.chroma_format_idc)
|
||||
#define CHROMA422(h) (h->sps.chroma_format_idc == 2)
|
||||
#define CHROMA444(h) (h->sps.chroma_format_idc == 3)
|
||||
#define CHROMA(h) ((h)->sps.chroma_format_idc)
|
||||
#define CHROMA422(h) ((h)->sps.chroma_format_idc == 2)
|
||||
#define CHROMA444(h) ((h)->sps.chroma_format_idc == 3)
|
||||
|
||||
#define EXTENDED_SAR 255
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ static int h264_mp4toannexb_filter(AVBitStreamFilterContext *bsfc,
|
||||
goto fail;
|
||||
|
||||
/* prepend only to the first type 5 NAL unit of an IDR picture */
|
||||
if (ctx->first_idr && unit_type == 5) {
|
||||
if (ctx->first_idr && (unit_type == 5 || unit_type == 7 || unit_type == 8)) {
|
||||
if ((ret=alloc_and_copy(poutbuf, poutbuf_size,
|
||||
avctx->extradata, avctx->extradata_size,
|
||||
buf, nal_size)) < 0)
|
||||
|
||||
+4
-4
@@ -81,10 +81,10 @@
|
||||
#define SAMPLE_CTB(tab, x, y) ((tab)[(y) * min_cb_width + (x)])
|
||||
#define SAMPLE_CBF(tab, x, y) ((tab)[((y) & ((1<<log2_trafo_size)-1)) * MAX_CU_SIZE + ((x) & ((1<<log2_trafo_size)-1))])
|
||||
|
||||
#define IS_IDR(s) (s->nal_unit_type == NAL_IDR_W_RADL || s->nal_unit_type == NAL_IDR_N_LP)
|
||||
#define IS_BLA(s) (s->nal_unit_type == NAL_BLA_W_RADL || s->nal_unit_type == NAL_BLA_W_LP || \
|
||||
s->nal_unit_type == NAL_BLA_N_LP)
|
||||
#define IS_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23)
|
||||
#define IS_IDR(s) ((s)->nal_unit_type == NAL_IDR_W_RADL || (s)->nal_unit_type == NAL_IDR_N_LP)
|
||||
#define IS_BLA(s) ((s)->nal_unit_type == NAL_BLA_W_RADL || (s)->nal_unit_type == NAL_BLA_W_LP || \
|
||||
(s)->nal_unit_type == NAL_BLA_N_LP)
|
||||
#define IS_IRAP(s) ((s)->nal_unit_type >= 16 && (s)->nal_unit_type <= 23)
|
||||
|
||||
/**
|
||||
* Table 7-3: NAL unit type codes
|
||||
|
||||
+19
-19
@@ -235,15 +235,15 @@ void ff_ivi_recompose_haar(const IVIPlaneDesc *plane, uint8_t *dst,
|
||||
|
||||
/** butterfly operation for the inverse Haar transform */
|
||||
#define IVI_HAAR_BFLY(s1, s2, o1, o2, t) \
|
||||
t = (s1 - s2) >> 1;\
|
||||
o1 = (s1 + s2) >> 1;\
|
||||
o2 = t;\
|
||||
t = ((s1) - (s2)) >> 1;\
|
||||
o1 = ((s1) + (s2)) >> 1;\
|
||||
o2 = (t);\
|
||||
|
||||
/** inverse 8-point Haar transform */
|
||||
#define INV_HAAR8(s1, s5, s3, s7, s2, s4, s6, s8,\
|
||||
d1, d2, d3, d4, d5, d6, d7, d8,\
|
||||
t0, t1, t2, t3, t4, t5, t6, t7, t8) {\
|
||||
t1 = s1 << 1; t5 = s5 << 1;\
|
||||
t1 = (s1) << 1; t5 = (s5) << 1;\
|
||||
IVI_HAAR_BFLY(t1, t5, t1, t5, t0); IVI_HAAR_BFLY(t1, s3, t1, t3, t0);\
|
||||
IVI_HAAR_BFLY(t5, s7, t5, t7, t0); IVI_HAAR_BFLY(t1, s2, t1, t2, t0);\
|
||||
IVI_HAAR_BFLY(t3, s4, t3, t4, t0); IVI_HAAR_BFLY(t5, s6, t5, t6, t0);\
|
||||
@@ -485,21 +485,21 @@ void ff_ivi_dc_haar_2d(const int32_t *in, int16_t *out, uint32_t pitch,
|
||||
|
||||
/** butterfly operation for the inverse slant transform */
|
||||
#define IVI_SLANT_BFLY(s1, s2, o1, o2, t) \
|
||||
t = s1 - s2;\
|
||||
o1 = s1 + s2;\
|
||||
o2 = t;\
|
||||
t = (s1) - (s2);\
|
||||
o1 = (s1) + (s2);\
|
||||
o2 = (t);\
|
||||
|
||||
/** This is a reflection a,b = 1/2, 5/4 for the inverse slant transform */
|
||||
#define IVI_IREFLECT(s1, s2, o1, o2, t) \
|
||||
t = ((s1 + s2*2 + 2) >> 2) + s1;\
|
||||
o2 = ((s1*2 - s2 + 2) >> 2) - s2;\
|
||||
o1 = t;\
|
||||
t = (((s1) + (s2)*2 + 2) >> 2) + (s1);\
|
||||
o2 = (((s1)*2 - (s2) + 2) >> 2) - (s2);\
|
||||
o1 = (t);\
|
||||
|
||||
/** This is a reflection a,b = 1/2, 7/8 for the inverse slant transform */
|
||||
#define IVI_SLANT_PART4(s1, s2, o1, o2, t) \
|
||||
t = s2 + ((s1*4 - s2 + 4) >> 3);\
|
||||
o2 = s1 + ((-s1 - s2*4 + 4) >> 3);\
|
||||
o1 = t;\
|
||||
t = (s2) + (((s1)*4 - (s2) + 4) >> 3);\
|
||||
o2 = (s1) + ((-(s1) - (s2)*4 + 4) >> 3);\
|
||||
o1 = (t);\
|
||||
|
||||
/** inverse slant8 transform */
|
||||
#define IVI_INV_SLANT8(s1, s4, s8, s5, s2, s6, s3, s7,\
|
||||
@@ -557,7 +557,7 @@ void ff_ivi_inverse_slant_8x8(const int32_t *in, int16_t *out, uint32_t pitch, c
|
||||
}
|
||||
#undef COMPENSATE
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
src = tmp;
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (!src[0] && !src[1] && !src[2] && !src[3] && !src[4] && !src[5] && !src[6] && !src[7]) {
|
||||
@@ -597,7 +597,7 @@ void ff_ivi_inverse_slant_4x4(const int32_t *in, int16_t *out, uint32_t pitch, c
|
||||
}
|
||||
#undef COMPENSATE
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
src = tmp;
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!src[0] && !src[1] && !src[2] && !src[3]) {
|
||||
@@ -631,7 +631,7 @@ void ff_ivi_row_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
int i;
|
||||
int t0, t1, t2, t3, t4, t5, t6, t7, t8;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (!in[0] && !in[1] && !in[2] && !in[3] && !in[4] && !in[5] && !in[6] && !in[7]) {
|
||||
memset(out, 0, 8*sizeof(out[0]));
|
||||
@@ -673,7 +673,7 @@ void ff_ivi_col_slant8(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
row4 = pitch << 2;
|
||||
row8 = pitch << 3;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 8; i++) {
|
||||
if (flags[i]) {
|
||||
IVI_INV_SLANT8(in[0], in[8], in[16], in[24], in[32], in[40], in[48], in[56],
|
||||
@@ -710,7 +710,7 @@ void ff_ivi_row_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
int i;
|
||||
int t0, t1, t2, t3, t4;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (!in[0] && !in[1] && !in[2] && !in[3]) {
|
||||
memset(out, 0, 4*sizeof(out[0]));
|
||||
@@ -732,7 +732,7 @@ void ff_ivi_col_slant4(const int32_t *in, int16_t *out, uint32_t pitch, const ui
|
||||
|
||||
row2 = pitch << 1;
|
||||
|
||||
#define COMPENSATE(x) ((x + 1)>>1)
|
||||
#define COMPENSATE(x) (((x) + 1)>>1)
|
||||
for (i = 0; i < 4; i++) {
|
||||
if (flags[i]) {
|
||||
IVI_INV_SLANT4(in[0], in[4], in[8], in[12],
|
||||
|
||||
@@ -349,7 +349,8 @@ static int libvorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
avctx->delay = duration;
|
||||
av_assert0(!s->afq.remaining_delay);
|
||||
s->afq.frames->duration += duration;
|
||||
s->afq.frames->pts -= duration;
|
||||
if (s->afq.frames->pts != AV_NOPTS_VALUE)
|
||||
s->afq.frames->pts -= duration;
|
||||
s->afq.remaining_samples += duration;
|
||||
}
|
||||
ff_af_queue_remove(&s->afq, duration, &avpkt->pts, &avpkt->duration);
|
||||
|
||||
+13
-13
@@ -391,19 +391,6 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
|
||||
OPT_STR("level", x4->level);
|
||||
|
||||
if(x4->x264opts){
|
||||
const char *p= x4->x264opts;
|
||||
while(p){
|
||||
char param[256]={0}, val[256]={0};
|
||||
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
|
||||
OPT_STR(param, "1");
|
||||
}else
|
||||
OPT_STR(param, val);
|
||||
p= strchr(p, ':');
|
||||
p+=!!p;
|
||||
}
|
||||
}
|
||||
|
||||
if (avctx->i_quant_factor > 0)
|
||||
x4->params.rc.f_ip_factor = 1 / fabs(avctx->i_quant_factor);
|
||||
|
||||
@@ -589,6 +576,19 @@ static av_cold int X264_init(AVCodecContext *avctx)
|
||||
if (avctx->flags & CODEC_FLAG_GLOBAL_HEADER)
|
||||
x4->params.b_repeat_headers = 0;
|
||||
|
||||
if(x4->x264opts){
|
||||
const char *p= x4->x264opts;
|
||||
while(p){
|
||||
char param[256]={0}, val[256]={0};
|
||||
if(sscanf(p, "%255[^:=]=%255[^:]", param, val) == 1){
|
||||
OPT_STR(param, "1");
|
||||
}else
|
||||
OPT_STR(param, val);
|
||||
p= strchr(p, ':');
|
||||
p+=!!p;
|
||||
}
|
||||
}
|
||||
|
||||
if (x4->x264_params) {
|
||||
AVDictionary *dict = NULL;
|
||||
AVDictionaryEntry *en = NULL;
|
||||
|
||||
@@ -81,6 +81,7 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||
libx265Context *ctx = avctx->priv_data;
|
||||
x265_nal *nal;
|
||||
uint8_t *buf;
|
||||
char sar[10];
|
||||
int sar_num, sar_den;
|
||||
int nnal;
|
||||
int ret;
|
||||
@@ -121,11 +122,11 @@ static av_cold int libx265_encode_init(AVCodecContext *avctx)
|
||||
av_reduce(&sar_num, &sar_den,
|
||||
avctx->sample_aspect_ratio.num,
|
||||
avctx->sample_aspect_ratio.den, 4096);
|
||||
ctx->params->bEnableVuiParametersPresentFlag = 1;
|
||||
ctx->params->bEnableAspectRatioIdc = 1;
|
||||
ctx->params->aspectRatioIdc = 255;
|
||||
ctx->params->sarWidth = sar_num;
|
||||
ctx->params->sarHeight = sar_den;
|
||||
snprintf(sar, sizeof(sar), "%d:%d", sar_num, sar_den);
|
||||
if (x265_param_parse(ctx->params, "sar", sar) == X265_PARAM_BAD_VALUE) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Invalid SAR: %d:%d.\n", sar_num, sar_den);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (x265_max_bit_depth == 8)
|
||||
ctx->params->internalBitDepth = 8;
|
||||
|
||||
@@ -1251,7 +1251,7 @@ static int mjpeg_decode_scan_progressive_ac(MJpegDecodeContext *s, int ss,
|
||||
}
|
||||
|
||||
if (!Al) {
|
||||
s->coefs_finished[c] |= (1LL << (se + 1)) - (1LL << ss);
|
||||
s->coefs_finished[c] |= (2LL << se) - (1LL << ss);
|
||||
last_scan = !~s->coefs_finished[c];
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ static void encode_block(MpegEncContext *s, int16_t *block, int n)
|
||||
put_bits(&s->pb, huff_size_ac[0], huff_code_ac[0]);
|
||||
}
|
||||
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64])
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64])
|
||||
{
|
||||
int i;
|
||||
if (s->chroma_format == CHROMA_444) {
|
||||
|
||||
@@ -61,6 +61,6 @@ void ff_mjpeg_encode_stuffing(MpegEncContext *s);
|
||||
void ff_mjpeg_init_hvsample(AVCodecContext *avctx, int hsample[3], int vsample[3]);
|
||||
void ff_mjpeg_encode_dc(PutBitContext *pb, int val,
|
||||
uint8_t *huff_size, uint16_t *huff_code);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[6][64]);
|
||||
void ff_mjpeg_encode_mb(MpegEncContext *s, int16_t block[12][64]);
|
||||
|
||||
#endif /* AVCODEC_MJPEGENC_H */
|
||||
|
||||
+1
-1
@@ -872,7 +872,7 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define MSB_MASK(bits) (-1u << bits)
|
||||
#define MSB_MASK(bits) (-1u << (bits))
|
||||
|
||||
/** Generate PCM samples using the prediction filters and residual values
|
||||
* read from the data stream, and update the filter state. */
|
||||
|
||||
@@ -1774,7 +1774,7 @@ int ff_MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (!avctx->hwaccel) {
|
||||
if (!avctx->hwaccel && !(avctx->codec->capabilities&CODEC_CAP_HWACCEL_VDPAU)) {
|
||||
for(i=0; i<avctx->height; i++)
|
||||
memset(s->last_picture_ptr->f.data[0] + s->last_picture_ptr->f.linesize[0]*i,
|
||||
0x80, avctx->width);
|
||||
|
||||
@@ -116,6 +116,9 @@ static int msrle_decode_frame(AVCodecContext *avctx,
|
||||
uint8_t *buf = avpkt->data + (avctx->height-1)*istride;
|
||||
int i, j;
|
||||
|
||||
if (linesize < 0)
|
||||
return linesize;
|
||||
|
||||
for (i = 0; i < avctx->height; i++) {
|
||||
if (avctx->bits_per_coded_sample == 4) {
|
||||
for (j = 0; j < avctx->width - 1; j += 2) {
|
||||
|
||||
@@ -84,8 +84,8 @@ void ff_mss34_gen_quant_mat(uint16_t *qmat, int quality, int luma)
|
||||
blk[6 * step] = (-(t3 + t7) + t8 + tA) >> shift; \
|
||||
blk[7 * step] = (-(t1 + t6) + t9 + tB) >> shift; \
|
||||
|
||||
#define SOP_ROW(a) ((a) << 16) + 0x2000
|
||||
#define SOP_COL(a) ((a + 32) << 16)
|
||||
#define SOP_ROW(a) (((a) << 16) + 0x2000)
|
||||
#define SOP_COL(a) (((a) + 32) << 16)
|
||||
|
||||
void ff_mss34_dct_put(uint8_t *dst, int stride, int *block)
|
||||
{
|
||||
|
||||
+1
-1
@@ -364,7 +364,7 @@ static int get_value_cached(GetBitContext *gb, int vec_pos, uint8_t *vec,
|
||||
return prev[component];
|
||||
}
|
||||
|
||||
#define MKVAL(vals) (vals[0] | (vals[1] << 3) | (vals[2] << 6))
|
||||
#define MKVAL(vals) ((vals)[0] | ((vals)[1] << 3) | ((vals)[2] << 6))
|
||||
|
||||
/* Image mode - the hardest to comprehend MSS4 coding mode.
|
||||
*
|
||||
|
||||
@@ -36,12 +36,20 @@
|
||||
|
||||
.macro extfunc name
|
||||
.global X(\name)
|
||||
#if _CALL_ELF == 2
|
||||
.text
|
||||
X(\name):
|
||||
addis %r2, %r12, .TOC.-X(\name)@ha
|
||||
addi %r2, %r2, .TOC.-X(\name)@l
|
||||
.localentry X(\name), .-X(\name)
|
||||
#else
|
||||
.section .opd, "aw"
|
||||
X(\name):
|
||||
.quad L(\name), .TOC.@tocbase, 0
|
||||
.previous
|
||||
.type X(\name), STT_FUNC
|
||||
L(\name):
|
||||
#endif
|
||||
.endm
|
||||
|
||||
.macro movrel rd, sym, gp
|
||||
|
||||
@@ -356,8 +356,10 @@ static int submit_packet(PerThreadContext *p, AVPacket *avpkt)
|
||||
memcpy(p->buf, avpkt->data, avpkt->size);
|
||||
memset(p->buf + avpkt->size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
}
|
||||
if ((ret = av_copy_packet_side_data(&p->avpkt, avpkt)) < 0)
|
||||
if ((ret = av_copy_packet_side_data(&p->avpkt, avpkt)) < 0) {
|
||||
pthread_mutex_unlock(&p->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
p->state = STATE_SETTING_UP;
|
||||
pthread_cond_signal(&p->input_cond);
|
||||
|
||||
+2
-2
@@ -1187,7 +1187,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
|
||||
if (h->pict_type != AV_PICTURE_TYPE_I) {
|
||||
if (!s->last_pic->f.data[0]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
|
||||
av_frame_unref(s->last_pic);
|
||||
av_frame_unref(&s->last_pic->f);
|
||||
ret = get_buffer(avctx, s->last_pic);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
@@ -1200,7 +1200,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
|
||||
|
||||
if (h->pict_type == AV_PICTURE_TYPE_B && !s->next_pic->f.data[0]) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Missing reference frame.\n");
|
||||
av_frame_unref(s->next_pic);
|
||||
av_frame_unref(&s->next_pic->f);
|
||||
ret = get_buffer(avctx, s->next_pic);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
+2
-1
@@ -1912,9 +1912,10 @@ static void vc1_interp_mc(VC1Context *v)
|
||||
uvmx = (mx + ((mx & 3) == 3)) >> 1;
|
||||
uvmy = (my + ((my & 3) == 3)) >> 1;
|
||||
if (v->field_mode) {
|
||||
if (v->cur_field_type != v->ref_field_type[1])
|
||||
if (v->cur_field_type != v->ref_field_type[1]) {
|
||||
my = my - 2 + 4 * v->cur_field_type;
|
||||
uvmy = uvmy - 2 + 4 * v->cur_field_type;
|
||||
}
|
||||
}
|
||||
if (v->fastuvmc) {
|
||||
uvmx = uvmx + ((uvmx < 0) ? -(uvmx & 1) : (uvmx & 1));
|
||||
|
||||
@@ -85,6 +85,11 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
|
||||
|
||||
++p;
|
||||
|
||||
for (i = p; (bits[i] == 0) && (i < num); ++i)
|
||||
;
|
||||
if (i == num)
|
||||
return 0;
|
||||
|
||||
for (; p < num; ++p) {
|
||||
if (bits[p] > 32)
|
||||
return 1;
|
||||
|
||||
+26
-11
@@ -151,7 +151,7 @@ typedef struct vorbis_context_s {
|
||||
uint8_t mode_count;
|
||||
vorbis_mode *modes;
|
||||
uint8_t mode_number; // mode number for the current packet
|
||||
uint8_t previous_window;
|
||||
int8_t previous_window;
|
||||
float *channel_residues;
|
||||
float *saved;
|
||||
} vorbis_context;
|
||||
@@ -701,8 +701,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
|
||||
res_setup->partition_size = get_bits(gb, 24) + 1;
|
||||
/* Validations to prevent a buffer overflow later. */
|
||||
if (res_setup->begin>res_setup->end ||
|
||||
res_setup->end > (res_setup->type == 2 ? vc->audio_channels : 1) * vc->blocksize[1] / 2 ||
|
||||
(res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
|
||||
(res_setup->end-res_setup->begin) / res_setup->partition_size > FFMIN(V_MAX_PARTITIONS, 65535)) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR,
|
||||
"partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
|
||||
res_setup->type, res_setup->begin, res_setup->end,
|
||||
@@ -989,7 +988,7 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
|
||||
if (!vc->channel_residues || !vc->saved)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
vc->previous_window = 0;
|
||||
vc->previous_window = -1;
|
||||
|
||||
ff_mdct_init(&vc->mdct[0], bl0, 1, -1.0);
|
||||
ff_mdct_init(&vc->mdct[1], bl1, 1, -1.0);
|
||||
@@ -1372,6 +1371,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
unsigned pass, ch_used, i, j, k, l;
|
||||
unsigned max_output = (ch - 1) * vlen;
|
||||
int ptns_to_read = vr->ptns_to_read;
|
||||
int libvorbis_bug = 0;
|
||||
|
||||
if (vr_type == 2) {
|
||||
for (j = 1; j < ch; ++j)
|
||||
@@ -1386,8 +1386,13 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
}
|
||||
|
||||
if (max_output > ch_left * vlen) {
|
||||
av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
if (max_output <= ch_left * vlen + vr->partition_size*ch_used/ch) {
|
||||
ptns_to_read--;
|
||||
libvorbis_bug = 1;
|
||||
} else {
|
||||
av_log(vc->avctx, AV_LOG_ERROR, "Insufficient output buffer\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
}
|
||||
|
||||
av_dlog(NULL, " residue type 0/1/2 decode begin, ch: %d cpc %d \n", ch, c_p_c);
|
||||
@@ -1496,6 +1501,14 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
|
||||
voffset += vr->partition_size;
|
||||
}
|
||||
}
|
||||
if (libvorbis_bug && !pass) {
|
||||
for (j = 0; j < ch_used; ++j) {
|
||||
if (!do_not_decode[j]) {
|
||||
get_vlc2(&vc->gb, vc->codebooks[vr->classbook].vlc.table,
|
||||
vc->codebooks[vr->classbook].nb_bits, 3);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1548,7 +1561,7 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
|
||||
{
|
||||
GetBitContext *gb = &vc->gb;
|
||||
FFTContext *mdct;
|
||||
unsigned previous_window = vc->previous_window;
|
||||
int previous_window = vc->previous_window;
|
||||
unsigned mode_number, blockflag, blocksize;
|
||||
int i, j;
|
||||
uint8_t no_residue[255];
|
||||
@@ -1581,9 +1594,11 @@ static int vorbis_parse_audio_packet(vorbis_context *vc, float **floor_ptr)
|
||||
blocksize = vc->blocksize[blockflag];
|
||||
vlen = blocksize / 2;
|
||||
if (blockflag) {
|
||||
previous_window = get_bits(gb, 1);
|
||||
skip_bits1(gb); // next_window
|
||||
}
|
||||
int code = get_bits(gb, 2);
|
||||
if (previous_window < 0)
|
||||
previous_window = code>>1;
|
||||
} else if (previous_window < 0)
|
||||
previous_window = 0;
|
||||
|
||||
memset(ch_res_ptr, 0, sizeof(float) * vc->audio_channels * vlen); //FIXME can this be removed ?
|
||||
for (i = 0; i < vc->audio_channels; ++i)
|
||||
@@ -1812,7 +1827,7 @@ static av_cold void vorbis_decode_flush(AVCodecContext *avctx)
|
||||
memset(vc->saved, 0, (vc->blocksize[1] / 4) * vc->audio_channels *
|
||||
sizeof(*vc->saved));
|
||||
}
|
||||
vc->previous_window = 0;
|
||||
vc->previous_window = -1;
|
||||
}
|
||||
|
||||
AVCodec ff_vorbis_decoder = {
|
||||
|
||||
+3
-3
@@ -386,9 +386,9 @@ int ff_wma_end(AVCodecContext *avctx)
|
||||
}
|
||||
for (i = 0; i < 2; i++) {
|
||||
ff_free_vlc(&s->coef_vlc[i]);
|
||||
av_free(s->run_table[i]);
|
||||
av_free(s->level_table[i]);
|
||||
av_free(s->int_table[i]);
|
||||
av_freep(&s->run_table[i]);
|
||||
av_freep(&s->level_table[i]);
|
||||
av_freep(&s->int_table[i]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -343,7 +343,7 @@ DECLARE_ASM_CONST(16, int32_t, walkenIdctRounders)[] = {
|
||||
"movdqa %%xmm6, 4*16("dct") \n\t" \
|
||||
"movdqa "SREG2", 7*16("dct") \n\t"
|
||||
|
||||
inline void ff_idct_xvid_sse2(short *block)
|
||||
av_extern_inline void ff_idct_xvid_sse2(short *block)
|
||||
{
|
||||
__asm__ volatile(
|
||||
"movq "MANGLE(m127)", %%mm0 \n\t"
|
||||
|
||||
@@ -216,7 +216,7 @@ static int RENAME(dct_quantize)(MpegEncContext *s,
|
||||
"psubusw "MM"1, "MM"4 \n\t"
|
||||
"packuswb "MM"4, "MM"4 \n\t"
|
||||
#if COMPILE_TEMPLATE_SSE2
|
||||
"packuswb "MM"4, "MM"4 \n\t"
|
||||
"packsswb "MM"4, "MM"4 \n\t"
|
||||
#endif
|
||||
"movd "MM"4, %0 \n\t" // *overflow
|
||||
: "=g" (*overflow)
|
||||
|
||||
@@ -1204,6 +1204,8 @@ static int opengl_draw(AVFormatContext *h, void *input, int repaint, int is_pkt)
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
if (!repaint) {
|
||||
if (is_pkt)
|
||||
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
|
||||
LOAD_TEXTURE_DATA(0, 0)
|
||||
if (desc->flags & AV_PIX_FMT_FLAG_PLANAR) {
|
||||
LOAD_TEXTURE_DATA(1, 1)
|
||||
|
||||
@@ -389,6 +389,8 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *buf)
|
||||
}
|
||||
}
|
||||
|
||||
emms_c();
|
||||
|
||||
if (buf != out_buf)
|
||||
av_frame_free(&buf);
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ static double get_scene_score(AVFilterContext *ctx, AVFrame *frame)
|
||||
p2 += 8 * linesize;
|
||||
}
|
||||
emms_c();
|
||||
mafd = nb_sad ? sad / nb_sad : 0;
|
||||
mafd = nb_sad ? (double)sad / nb_sad : 0;
|
||||
diff = fabs(mafd - select->prev_mafd);
|
||||
ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1);
|
||||
select->prev_mafd = mafd;
|
||||
|
||||
@@ -38,7 +38,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
if(av_get_pix_fmt_name(fmts->formats[j])) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_pix_fmt_name(fmts->formats[j])); \
|
||||
} else if (filter_ctx->inout##puts[i]->type == AVMEDIA_TYPE_AUDIO) { \
|
||||
AVFilterFormats *fmts; \
|
||||
@@ -47,7 +47,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
fmts = filter_ctx->inout##puts[i]->outin##_formats; \
|
||||
for (j = 0; j < fmts->nb_formats; j++) \
|
||||
printf(#INOUT "PUT[%d] %s: fmt:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, \
|
||||
i, filter_ctx->inout##put_pads[i].name, \
|
||||
av_get_sample_fmt_name(fmts->formats[j])); \
|
||||
\
|
||||
layouts = filter_ctx->inout##puts[i]->outin##_channel_layouts; \
|
||||
@@ -56,7 +56,7 @@ static void print_formats(AVFilterContext *filter_ctx)
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, \
|
||||
layouts->channel_layouts[j]); \
|
||||
printf(#INOUT "PUT[%d] %s: chlayout:%s\n", \
|
||||
i, filter_ctx->filter->inout##puts[i].name, buf); \
|
||||
i, filter_ctx->inout##put_pads[i].name, buf); \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
@@ -113,12 +113,12 @@ int main(int argc, char **argv)
|
||||
/* create a link for each of the input pads */
|
||||
for (i = 0; i < filter_ctx->nb_inputs; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->inputs[i].type;
|
||||
link->type = filter_ctx->input_pads[i].type;
|
||||
filter_ctx->inputs[i] = link;
|
||||
}
|
||||
for (i = 0; i < filter_ctx->nb_outputs; i++) {
|
||||
AVFilterLink *link = av_mallocz(sizeof(AVFilterLink));
|
||||
link->type = filter_ctx->filter->outputs[i].type;
|
||||
link->type = filter_ctx->output_pads[i].type;
|
||||
filter_ctx->outputs[i] = link;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,9 +31,10 @@ static int print_link_prop(AVBPrint *buf, AVFilterLink *link)
|
||||
{
|
||||
char *format;
|
||||
char layout[64];
|
||||
AVBPrint dummy_buffer = { 0 };
|
||||
|
||||
if (!buf)
|
||||
buf = &(AVBPrint){ 0 }; /* dummy buffer */
|
||||
buf = &dummy_buffer;
|
||||
switch (link->type) {
|
||||
case AVMEDIA_TYPE_VIDEO:
|
||||
format = av_x_if_null(av_get_pix_fmt_name(link->format), "?");
|
||||
|
||||
@@ -306,8 +306,8 @@ static void find_motion(DeshakeContext *deshake, uint8_t *src1, uint8_t *src2,
|
||||
//av_log(NULL, AV_LOG_ERROR, "\n");
|
||||
}
|
||||
|
||||
p_x = (center_x - width / 2);
|
||||
p_y = (center_y - height / 2);
|
||||
p_x = (center_x - width / 2.0);
|
||||
p_y = (center_y - height / 2.0);
|
||||
t->vector.x += (cos(t->angle)-1)*p_x - sin(t->angle)*p_y;
|
||||
t->vector.y += sin(t->angle)*p_x + (cos(t->angle)-1)*p_y;
|
||||
|
||||
|
||||
@@ -147,6 +147,7 @@ static void denoise_depth(HQDN3DContext *s,
|
||||
else
|
||||
denoise_temporal(src, dst, frame_ant,
|
||||
w, h, sstride, dstride, temporal, depth);
|
||||
emms_c();
|
||||
}
|
||||
|
||||
#define denoise(...) \
|
||||
|
||||
+16
-12
@@ -126,20 +126,21 @@ static int alloc_metrics(PullupContext *s, PullupField *f)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void free_field_queue(PullupField *head, PullupField **last)
|
||||
static void free_field_queue(PullupField *head)
|
||||
{
|
||||
PullupField *f = head;
|
||||
while (f) {
|
||||
do {
|
||||
PullupField *next;
|
||||
if (!f)
|
||||
break;
|
||||
av_free(f->diffs);
|
||||
av_free(f->combs);
|
||||
av_free(f->vars);
|
||||
if (f == *last) {
|
||||
av_freep(last);
|
||||
break;
|
||||
}
|
||||
f = f->next;
|
||||
av_freep(&f->prev);
|
||||
};
|
||||
next = f->next;
|
||||
memset(f, 0, sizeof(*f));
|
||||
av_free(f);
|
||||
f = next;
|
||||
} while (f != head);
|
||||
}
|
||||
|
||||
static PullupField *make_field_queue(PullupContext *s, int len)
|
||||
@@ -158,14 +159,14 @@ static PullupField *make_field_queue(PullupContext *s, int len)
|
||||
for (; len > 0; len--) {
|
||||
f->next = av_mallocz(sizeof(*f->next));
|
||||
if (!f->next) {
|
||||
free_field_queue(head, &f);
|
||||
free_field_queue(head);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
f->next->prev = f;
|
||||
f = f->next;
|
||||
if (alloc_metrics(s, f) < 0) {
|
||||
free_field_queue(head, &f);
|
||||
free_field_queue(head);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
@@ -255,6 +256,8 @@ static int alloc_buffer(PullupContext *s, PullupBuffer *b)
|
||||
for (i = 0; i < s->nb_planes; i++) {
|
||||
b->planes[i] = av_malloc(s->planeheight[i] * s->planewidth[i]);
|
||||
}
|
||||
if (s->nb_planes == 1)
|
||||
b->planes[1] = av_malloc(4*256);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -736,7 +739,8 @@ static av_cold void uninit(AVFilterContext *ctx)
|
||||
PullupContext *s = ctx->priv;
|
||||
int i;
|
||||
|
||||
free_field_queue(s->head, &s->last);
|
||||
free_field_queue(s->head);
|
||||
s->last = NULL;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(s->buffers); i++) {
|
||||
av_freep(&s->buffers[i].planes[0]);
|
||||
|
||||
@@ -84,7 +84,7 @@ OBJS-$(CONFIG_AST_MUXER) += ast.o astenc.o
|
||||
OBJS-$(CONFIG_AU_DEMUXER) += au.o pcm.o
|
||||
OBJS-$(CONFIG_AU_MUXER) += au.o rawenc.o
|
||||
OBJS-$(CONFIG_AVI_DEMUXER) += avidec.o
|
||||
OBJS-$(CONFIG_AVI_MUXER) += avienc.o
|
||||
OBJS-$(CONFIG_AVI_MUXER) += avienc.o avlanguage.o
|
||||
OBJS-$(CONFIG_AVISYNTH) += avisynth.o
|
||||
OBJS-$(CONFIG_AVM2_MUXER) += swfenc.o swf.o
|
||||
OBJS-$(CONFIG_AVR_DEMUXER) += avr.o pcm.o
|
||||
|
||||
@@ -237,7 +237,7 @@ static int aiff_read_header(AVFormatContext *s)
|
||||
break;
|
||||
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, size);
|
||||
if (id3v2_extra_meta)
|
||||
if ((ret = ff_id3v2_parse_apic(s, &id3v2_extra_meta)) < 0) {
|
||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||
|
||||
@@ -266,7 +266,7 @@ static void get_id3_tag(AVFormatContext *s, int len)
|
||||
{
|
||||
ID3v2ExtraMeta *id3v2_extra_meta = NULL;
|
||||
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, len);
|
||||
if (id3v2_extra_meta)
|
||||
ff_id3v2_parse_apic(s, &id3v2_extra_meta);
|
||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||
|
||||
@@ -611,6 +611,7 @@ static int asf_write_header(AVFormatContext *s)
|
||||
ASFContext *asf = s->priv_data;
|
||||
|
||||
s->packet_size = PACKET_SIZE;
|
||||
s->max_interleave_delta = 0;
|
||||
asf->nb_packets = 0;
|
||||
|
||||
asf->index_ptr = av_malloc(sizeof(ASFIndex) * ASF_INDEX_BLOCK);
|
||||
|
||||
@@ -844,6 +844,12 @@ typedef struct AVStream {
|
||||
double (*duration_error)[2][MAX_STD_TIMEBASES];
|
||||
int64_t codec_info_duration;
|
||||
int64_t codec_info_duration_fields;
|
||||
|
||||
/**
|
||||
* 0 -> decoder has not been searched for yet.
|
||||
* >0 -> decoder found
|
||||
* <0 -> decoder with codec_id == -found_decoder has not been found
|
||||
*/
|
||||
int found_decoder;
|
||||
|
||||
int64_t last_duration;
|
||||
|
||||
+65
-30
@@ -864,7 +864,11 @@ fail:
|
||||
if (!avi->index_loaded && pb->seekable)
|
||||
avi_load_index(s);
|
||||
avi->index_loaded |= 1;
|
||||
avi->non_interleaved |= guess_ni_flag(s) | (s->flags & AVFMT_FLAG_SORT_DTS);
|
||||
|
||||
if ((ret = guess_ni_flag(s)) < 0)
|
||||
return ret;
|
||||
|
||||
avi->non_interleaved |= ret | (s->flags & AVFMT_FLAG_SORT_DTS);
|
||||
|
||||
dict_entry = av_dict_get(s->metadata, "ISFT", NULL, 0);
|
||||
if (dict_entry && !strcmp(dict_entry->value, "PotEncoder"))
|
||||
@@ -1315,7 +1319,7 @@ FF_ENABLE_DEPRECATION_WARNINGS
|
||||
AVIndexEntry *e;
|
||||
int index;
|
||||
|
||||
index = av_index_search_timestamp(st, ast->frame_offset, 0);
|
||||
index = av_index_search_timestamp(st, ast->frame_offset, AVSEEK_FLAG_ANY);
|
||||
e = &st->index_entries[index];
|
||||
|
||||
if (index >= 0 && e->timestamp == ast->frame_offset) {
|
||||
@@ -1455,14 +1459,69 @@ static int avi_read_idx1(AVFormatContext *s, int size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Scan the index and consider any file with streams more than
|
||||
* 2 seconds or 64MB apart non-interleaved. */
|
||||
static int check_stream_max_drift(AVFormatContext *s)
|
||||
{
|
||||
int64_t min_pos, pos;
|
||||
int i;
|
||||
int *idx = av_mallocz_array(s->nb_streams, sizeof(*idx));
|
||||
if (!idx)
|
||||
return AVERROR(ENOMEM);
|
||||
for (min_pos = pos = 0; min_pos != INT64_MAX; pos = min_pos + 1LU) {
|
||||
int64_t max_dts = INT64_MIN / 2;
|
||||
int64_t min_dts = INT64_MAX / 2;
|
||||
int64_t max_buffer = 0;
|
||||
|
||||
min_pos = INT64_MAX;
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
AVIStream *ast = st->priv_data;
|
||||
int n = st->nb_index_entries;
|
||||
while (idx[i] < n && st->index_entries[idx[i]].pos < pos)
|
||||
idx[i]++;
|
||||
if (idx[i] < n) {
|
||||
int64_t dts;
|
||||
dts = av_rescale_q(st->index_entries[idx[i]].timestamp /
|
||||
FFMAX(ast->sample_size, 1),
|
||||
st->time_base, AV_TIME_BASE_Q);
|
||||
min_dts = FFMIN(min_dts, dts);
|
||||
min_pos = FFMIN(min_pos, st->index_entries[idx[i]].pos);
|
||||
}
|
||||
}
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
AVIStream *ast = st->priv_data;
|
||||
|
||||
if (idx[i] && min_dts != INT64_MAX / 2) {
|
||||
int64_t dts;
|
||||
dts = av_rescale_q(st->index_entries[idx[i] - 1].timestamp /
|
||||
FFMAX(ast->sample_size, 1),
|
||||
st->time_base, AV_TIME_BASE_Q);
|
||||
max_dts = FFMAX(max_dts, dts);
|
||||
max_buffer = FFMAX(max_buffer,
|
||||
av_rescale(dts - min_dts,
|
||||
st->codec->bit_rate,
|
||||
AV_TIME_BASE));
|
||||
}
|
||||
}
|
||||
if (max_dts - min_dts > 2 * AV_TIME_BASE ||
|
||||
max_buffer > 1024 * 1024 * 8 * 8) {
|
||||
av_free(idx);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
av_free(idx);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int guess_ni_flag(AVFormatContext *s)
|
||||
{
|
||||
int i;
|
||||
int64_t last_start = 0;
|
||||
int64_t first_end = INT64_MAX;
|
||||
int64_t oldpos = avio_tell(s->pb);
|
||||
int *idx;
|
||||
int64_t min_pos, pos;
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
@@ -1486,35 +1545,11 @@ static int guess_ni_flag(AVFormatContext *s)
|
||||
first_end = st->index_entries[n - 1].pos;
|
||||
}
|
||||
avio_seek(s->pb, oldpos, SEEK_SET);
|
||||
|
||||
if (last_start > first_end)
|
||||
return 1;
|
||||
idx= av_calloc(s->nb_streams, sizeof(*idx));
|
||||
if (!idx)
|
||||
return 0;
|
||||
for (min_pos=pos=0; min_pos!=INT64_MAX; pos= min_pos+1LU) {
|
||||
int64_t max_dts = INT64_MIN/2, min_dts= INT64_MAX/2;
|
||||
min_pos = INT64_MAX;
|
||||
|
||||
for (i=0; i<s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
AVIStream *ast = st->priv_data;
|
||||
int n= st->nb_index_entries;
|
||||
while (idx[i]<n && st->index_entries[idx[i]].pos < pos)
|
||||
idx[i]++;
|
||||
if (idx[i] < n) {
|
||||
min_dts = FFMIN(min_dts, av_rescale_q(st->index_entries[idx[i]].timestamp/FFMAX(ast->sample_size, 1), st->time_base, AV_TIME_BASE_Q));
|
||||
min_pos = FFMIN(min_pos, st->index_entries[idx[i]].pos);
|
||||
}
|
||||
if (idx[i])
|
||||
max_dts = FFMAX(max_dts, av_rescale_q(st->index_entries[idx[i]-1].timestamp/FFMAX(ast->sample_size, 1), st->time_base, AV_TIME_BASE_Q));
|
||||
}
|
||||
if (max_dts - min_dts > 2*AV_TIME_BASE) {
|
||||
av_free(idx);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
av_free(idx);
|
||||
return 0;
|
||||
return check_stream_max_drift(s);
|
||||
}
|
||||
|
||||
static int avi_load_index(AVFormatContext *s)
|
||||
|
||||
@@ -536,7 +536,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
sc->last_ts = ts;
|
||||
|
||||
avio_wb24(pb, size + flags_size);
|
||||
avio_wb24(pb, ts);
|
||||
avio_wb24(pb, ts & 0xFFFFFF);
|
||||
avio_w8(pb, (ts >> 24) & 0x7F); // timestamps are 32 bits _signed_
|
||||
avio_wb24(pb, flv->reserved);
|
||||
|
||||
|
||||
+18
-5
@@ -31,24 +31,37 @@ static int h263_probe(AVProbeData *p)
|
||||
int res_change=0;
|
||||
int src_fmt, last_src_fmt=-1;
|
||||
int last_gn=0;
|
||||
int tr, last_tr = -1;
|
||||
|
||||
for(i=0; i<p->buf_size; i++){
|
||||
code = (code<<8) + p->buf[i];
|
||||
if ((code & 0xfffffc0000) == 0x800000) {
|
||||
src_fmt= (code>>2)&3;
|
||||
if ((code & 0xfffffc000000) == 0x80000000) {
|
||||
tr = (code >> 18) & 0xFF;
|
||||
src_fmt= (code>>10)&7;
|
||||
if( src_fmt != last_src_fmt
|
||||
&& last_src_fmt>0 && last_src_fmt<6
|
||||
&& src_fmt<6)
|
||||
res_change++;
|
||||
|
||||
if((code&0x300)==0x200 && src_fmt){
|
||||
if (tr == last_tr) {
|
||||
invalid_psc++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (src_fmt != 7 && !(code&(1<<9)) && (code&(1<<5))) {
|
||||
invalid_psc++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if((code&0x30000)==0x20000 && src_fmt){
|
||||
valid_psc++;
|
||||
last_gn=0;
|
||||
}else
|
||||
invalid_psc++;
|
||||
last_src_fmt= src_fmt;
|
||||
} else if((code & 0xffff800000) == 0x800000) {
|
||||
int gn= (code>>(23-5)) & 0x1F;
|
||||
last_tr = tr;
|
||||
} else if((code & 0xffff80000000) == 0x80000000) {
|
||||
int gn= (code>>(31-5)) & 0x1F;
|
||||
if(gn<last_gn){
|
||||
invalid_psc++;
|
||||
}else
|
||||
|
||||
+16
-5
@@ -878,16 +878,25 @@ error:
|
||||
|
||||
static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
|
||||
AVFormatContext *s, const char *magic,
|
||||
ID3v2ExtraMeta **extra_meta)
|
||||
ID3v2ExtraMeta **extra_meta, int64_t max_search_size)
|
||||
{
|
||||
int len, ret;
|
||||
uint8_t buf[ID3v2_HEADER_SIZE];
|
||||
int found_header;
|
||||
int64_t off;
|
||||
int64_t start, off;
|
||||
|
||||
if (max_search_size && max_search_size < ID3v2_HEADER_SIZE)
|
||||
return;
|
||||
|
||||
start = avio_tell(pb);
|
||||
do {
|
||||
/* save the current offset in case there's nothing to read/skip */
|
||||
off = avio_tell(pb);
|
||||
if (max_search_size && off - start >= max_search_size - ID3v2_HEADER_SIZE) {
|
||||
avio_seek(pb, off, SEEK_SET);
|
||||
break;
|
||||
}
|
||||
|
||||
ret = avio_read(pb, buf, ID3v2_HEADER_SIZE);
|
||||
if (ret != ID3v2_HEADER_SIZE) {
|
||||
avio_seek(pb, off, SEEK_SET);
|
||||
@@ -914,13 +923,13 @@ static void id3v2_read_internal(AVIOContext *pb, AVDictionary **metadata,
|
||||
void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata,
|
||||
const char *magic, ID3v2ExtraMeta **extra_meta)
|
||||
{
|
||||
id3v2_read_internal(pb, metadata, NULL, magic, extra_meta);
|
||||
id3v2_read_internal(pb, metadata, NULL, magic, extra_meta, 0);
|
||||
}
|
||||
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic,
|
||||
ID3v2ExtraMeta **extra_meta)
|
||||
ID3v2ExtraMeta **extra_meta, unsigned int max_search_size)
|
||||
{
|
||||
id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta);
|
||||
id3v2_read_internal(s->pb, &s->metadata, s, magic, extra_meta, max_search_size);
|
||||
}
|
||||
|
||||
void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
|
||||
@@ -935,6 +944,8 @@ void ff_id3v2_free_extra_meta(ID3v2ExtraMeta **extra_meta)
|
||||
av_freep(¤t);
|
||||
current = next;
|
||||
}
|
||||
|
||||
*extra_meta = NULL;
|
||||
}
|
||||
|
||||
int ff_id3v2_parse_apic(AVFormatContext *s, ID3v2ExtraMeta **extra_meta)
|
||||
|
||||
+3
-1
@@ -112,8 +112,10 @@ void ff_id3v2_read_dict(AVIOContext *pb, AVDictionary **metadata, const char *ma
|
||||
*
|
||||
* @param extra_meta If not NULL, extra metadata is parsed into a list of
|
||||
* ID3v2ExtraMeta structs and *extra_meta points to the head of the list
|
||||
* @param[opt] max_search_search restrict ID3 magic number search (bytes from start)
|
||||
*/
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta);
|
||||
void ff_id3v2_read(AVFormatContext *s, const char *magic, ID3v2ExtraMeta **extra_meta,
|
||||
unsigned int max_search_size);
|
||||
|
||||
/**
|
||||
* Initialize an ID3v2 tag.
|
||||
|
||||
@@ -35,7 +35,7 @@ const CodecTags ff_mkv_codec_tags[]={
|
||||
{"A_MPEG/L2" , AV_CODEC_ID_MP2},
|
||||
{"A_MPEG/L1" , AV_CODEC_ID_MP2},
|
||||
{"A_MPEG/L3" , AV_CODEC_ID_MP3},
|
||||
{"A_OPUS", AV_CODEC_ID_OPUS},
|
||||
{"A_OPUS" , AV_CODEC_ID_OPUS},
|
||||
{"A_OPUS/EXPERIMENTAL",AV_CODEC_ID_OPUS},
|
||||
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F32LE},
|
||||
{"A_PCM/FLOAT/IEEE" , AV_CODEC_ID_PCM_F64LE},
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/lzo.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/dict.h"
|
||||
#if CONFIG_ZLIB
|
||||
#include <zlib.h>
|
||||
@@ -164,12 +165,12 @@ typedef struct {
|
||||
uint64_t default_duration;
|
||||
uint64_t flag_default;
|
||||
uint64_t flag_forced;
|
||||
uint64_t codec_delay;
|
||||
uint64_t seek_preroll;
|
||||
MatroskaTrackVideo video;
|
||||
MatroskaTrackAudio audio;
|
||||
MatroskaTrackOperation operation;
|
||||
EbmlList encodings;
|
||||
uint64_t codec_delay;
|
||||
|
||||
AVStream *stream;
|
||||
int64_t end_timecode;
|
||||
@@ -404,6 +405,7 @@ static EbmlSyntax matroska_track[] = {
|
||||
{ MATROSKA_ID_TRACKTYPE, EBML_UINT, 0, offsetof(MatroskaTrack,type) },
|
||||
{ MATROSKA_ID_CODECID, EBML_STR, 0, offsetof(MatroskaTrack,codec_id) },
|
||||
{ MATROSKA_ID_CODECPRIVATE, EBML_BIN, 0, offsetof(MatroskaTrack,codec_priv) },
|
||||
{ MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack,codec_delay) },
|
||||
{ MATROSKA_ID_TRACKLANGUAGE, EBML_UTF8, 0, offsetof(MatroskaTrack,language), {.s="eng"} },
|
||||
{ MATROSKA_ID_TRACKDEFAULTDURATION, EBML_UINT, 0, offsetof(MatroskaTrack,default_duration) },
|
||||
{ MATROSKA_ID_TRACKTIMECODESCALE, EBML_FLOAT,0, offsetof(MatroskaTrack,time_scale), {.f=1.0} },
|
||||
@@ -414,7 +416,6 @@ static EbmlSyntax matroska_track[] = {
|
||||
{ MATROSKA_ID_TRACKOPERATION, EBML_NEST, 0, offsetof(MatroskaTrack,operation), {.n=matroska_track_operation} },
|
||||
{ MATROSKA_ID_TRACKCONTENTENCODINGS,EBML_NEST, 0, 0, {.n=matroska_track_encodings} },
|
||||
{ MATROSKA_ID_TRACKMAXBLKADDID, EBML_UINT, 0, offsetof(MatroskaTrack,max_block_additional_id) },
|
||||
{ MATROSKA_ID_CODECDELAY, EBML_UINT, 0, offsetof(MatroskaTrack,codec_delay) },
|
||||
{ MATROSKA_ID_SEEKPREROLL, EBML_UINT, 0, offsetof(MatroskaTrack,seek_preroll) },
|
||||
{ MATROSKA_ID_TRACKFLAGENABLED, EBML_NONE },
|
||||
{ MATROSKA_ID_TRACKFLAGLACING, EBML_NONE },
|
||||
@@ -1852,6 +1853,11 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
track->time_scale = 1.0;
|
||||
avpriv_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
|
||||
|
||||
/* convert the delay from ns to the track timebase */
|
||||
track->codec_delay = av_rescale_q(track->codec_delay,
|
||||
(AVRational){ 1, 1000000000 },
|
||||
st->time_base);
|
||||
|
||||
st->codec->codec_id = codec_id;
|
||||
|
||||
if (strcmp(track->language, "und"))
|
||||
@@ -1934,7 +1940,7 @@ static int matroska_read_header(AVFormatContext *s)
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
if (track->codec_delay > 0) {
|
||||
st->codec->delay = av_rescale_q(track->codec_delay,
|
||||
(AVRational){1, 1000000000},
|
||||
st->time_base,
|
||||
(AVRational){1, st->codec->sample_rate});
|
||||
}
|
||||
if (track->seek_preroll > 0) {
|
||||
@@ -2615,7 +2621,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
|
||||
if (cluster_time != (uint64_t)-1
|
||||
&& (block_time >= 0 || cluster_time >= -block_time)) {
|
||||
timecode = cluster_time + block_time;
|
||||
timecode = cluster_time + block_time - track->codec_delay;
|
||||
if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE
|
||||
&& timecode < track->end_timecode)
|
||||
is_keyframe = 0; /* overlapping subtitles are not key frame */
|
||||
|
||||
@@ -1088,7 +1088,7 @@ static int mkv_write_header(AVFormatContext *s)
|
||||
AVIOContext *pb = s->pb;
|
||||
ebml_master ebml_header, segment_info;
|
||||
AVDictionaryEntry *tag;
|
||||
int ret, i;
|
||||
int ret, i, version = 2;
|
||||
|
||||
if (!strcmp(s->oformat->name, "webm")) mkv->mode = MODE_WEBM;
|
||||
else mkv->mode = MODE_MATROSKAv2;
|
||||
@@ -1096,7 +1096,12 @@ static int mkv_write_header(AVFormatContext *s)
|
||||
if (s->avoid_negative_ts < 0)
|
||||
s->avoid_negative_ts = 1;
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++)
|
||||
if (mkv->mode != MODE_WEBM ||
|
||||
av_dict_get(s->metadata, "stereo_mode", NULL, 0) ||
|
||||
av_dict_get(s->metadata, "alpha_mode", NULL, 0))
|
||||
version = 4;
|
||||
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
if (s->streams[i]->codec->codec_id == AV_CODEC_ID_ATRAC3 ||
|
||||
s->streams[i]->codec->codec_id == AV_CODEC_ID_COOK ||
|
||||
s->streams[i]->codec->codec_id == AV_CODEC_ID_RA_288 ||
|
||||
@@ -1108,6 +1113,11 @@ static int mkv_write_header(AVFormatContext *s)
|
||||
avcodec_get_name(s->streams[i]->codec->codec_id));
|
||||
return AVERROR_PATCHWELCOME;
|
||||
}
|
||||
if (s->streams[i]->codec->codec_id == AV_CODEC_ID_OPUS ||
|
||||
av_dict_get(s->streams[i]->metadata, "stereo_mode", NULL, 0) ||
|
||||
av_dict_get(s->streams[i]->metadata, "alpha_mode", NULL, 0))
|
||||
version = 4;
|
||||
}
|
||||
|
||||
mkv->tracks = av_mallocz(s->nb_streams * sizeof(*mkv->tracks));
|
||||
if (!mkv->tracks)
|
||||
@@ -1119,7 +1129,7 @@ static int mkv_write_header(AVFormatContext *s)
|
||||
put_ebml_uint (pb, EBML_ID_EBMLMAXIDLENGTH , 4);
|
||||
put_ebml_uint (pb, EBML_ID_EBMLMAXSIZELENGTH , 8);
|
||||
put_ebml_string (pb, EBML_ID_DOCTYPE , s->oformat->name);
|
||||
put_ebml_uint (pb, EBML_ID_DOCTYPEVERSION , 4);
|
||||
put_ebml_uint (pb, EBML_ID_DOCTYPEVERSION , version);
|
||||
put_ebml_uint (pb, EBML_ID_DOCTYPEREADVERSION , 2);
|
||||
end_ebml_master(pb, ebml_header);
|
||||
|
||||
|
||||
+1
-1
@@ -2167,7 +2167,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st)
|
||||
if (sc->keyframe_absent
|
||||
&& !sc->stps_count
|
||||
&& !rap_group_present
|
||||
&& st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
|
||||
&& (st->codec->codec_type == AVMEDIA_TYPE_AUDIO || (i==0 && j==0)))
|
||||
keyframe = 1;
|
||||
if (keyframe)
|
||||
distance = 0;
|
||||
|
||||
+33
-30
@@ -116,15 +116,16 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
{
|
||||
MP3Context *mp3 = s->priv_data;
|
||||
AVCodecContext *codec = s->streams[mp3->audio_stream_idx]->codec;
|
||||
int bitrate_idx;
|
||||
int best_bitrate_idx = -1;
|
||||
int best_bitrate_error= INT_MAX;
|
||||
int xing_offset;
|
||||
int32_t header, mask;
|
||||
MPADecodeHeader c;
|
||||
int srate_idx, ver = 0, i, channels;
|
||||
int needed;
|
||||
const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
|
||||
int32_t header;
|
||||
MPADecodeHeader mpah;
|
||||
int srate_idx, i, channels;
|
||||
int bitrate_idx;
|
||||
int best_bitrate_idx = -1;
|
||||
int best_bitrate_error = INT_MAX;
|
||||
int xing_offset;
|
||||
int ver = 0;
|
||||
int bytes_needed, lsf;
|
||||
const char *vendor = (codec->flags & CODEC_FLAG_BITEXACT) ? "Lavf" : LIBAVFORMAT_IDENT;
|
||||
|
||||
if (!s->pb->seekable || !mp3->write_xing)
|
||||
return 0;
|
||||
@@ -156,28 +157,29 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
/* dummy MPEG audio header */
|
||||
header = 0xffU << 24; // sync
|
||||
header |= (0x7 << 5 | ver << 3 | 0x1 << 1 | 0x1) << 16; // sync/audio-version/layer 3/no crc*/
|
||||
header |= (srate_idx << 2) << 8;
|
||||
header |= (srate_idx << 2) << 8;
|
||||
header |= channels << 6;
|
||||
|
||||
for (bitrate_idx=1; bitrate_idx<15; bitrate_idx++) {
|
||||
int error;
|
||||
avpriv_mpegaudio_decode_header(&c, header | (bitrate_idx << (4+8)));
|
||||
error= FFABS(c.bit_rate - codec->bit_rate);
|
||||
if(error < best_bitrate_error){
|
||||
best_bitrate_error= error;
|
||||
best_bitrate_idx = bitrate_idx;
|
||||
for (bitrate_idx = 1; bitrate_idx < 15; bitrate_idx++) {
|
||||
int bit_rate = 1000 * avpriv_mpa_bitrate_tab[lsf][3 - 1][bitrate_idx];
|
||||
int error = FFABS(bit_rate - codec->bit_rate);
|
||||
|
||||
if (error < best_bitrate_error) {
|
||||
best_bitrate_error = error;
|
||||
best_bitrate_idx = bitrate_idx;
|
||||
}
|
||||
}
|
||||
av_assert0(best_bitrate_idx >= 0);
|
||||
|
||||
for (bitrate_idx= best_bitrate_idx;; bitrate_idx++) {
|
||||
for (bitrate_idx = best_bitrate_idx; ; bitrate_idx++) {
|
||||
int32_t mask = bitrate_idx << (4 + 8);
|
||||
if (15 == bitrate_idx)
|
||||
return -1;
|
||||
mask = bitrate_idx << (4+8);
|
||||
header |= mask;
|
||||
avpriv_mpegaudio_decode_header(&c, header);
|
||||
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||
needed = 4 // header
|
||||
|
||||
avpriv_mpegaudio_decode_header(&mpah, header);
|
||||
xing_offset=xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
|
||||
bytes_needed = 4 // header
|
||||
+ xing_offset
|
||||
+ 4 // xing tag
|
||||
+ 4 // frames/size/toc flags
|
||||
@@ -187,8 +189,9 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
+ 24
|
||||
;
|
||||
|
||||
if (needed <= c.frame_size)
|
||||
if (bytes_needed <= mpah.frame_size)
|
||||
break;
|
||||
|
||||
header &= ~mask;
|
||||
}
|
||||
|
||||
@@ -199,7 +202,7 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
ffio_wfourcc(s->pb, "Xing");
|
||||
avio_wb32(s->pb, 0x01 | 0x02 | 0x04); // frames / size / TOC
|
||||
|
||||
mp3->size = c.frame_size;
|
||||
mp3->size = mpah.frame_size;
|
||||
mp3->want=1;
|
||||
mp3->seen=0;
|
||||
mp3->pos=0;
|
||||
@@ -217,7 +220,7 @@ static int mp3_write_xing(AVFormatContext *s)
|
||||
avio_w8(s->pb, 0);
|
||||
avio_wb24(s->pb, FFMAX(codec->delay - 528 - 1, 0)<<12);
|
||||
|
||||
ffio_fill(s->pb, 0, c.frame_size - needed);
|
||||
ffio_fill(s->pb, 0, mpah.frame_size - bytes_needed);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -257,7 +260,7 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
MP3Context *mp3 = s->priv_data;
|
||||
|
||||
if (pkt->data && pkt->size >= 4) {
|
||||
MPADecodeHeader c;
|
||||
MPADecodeHeader mpah;
|
||||
int av_unused base;
|
||||
uint32_t head = AV_RB32(pkt->data);
|
||||
|
||||
@@ -266,16 +269,16 @@ static int mp3_write_audio_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
"is invalid, writing it anyway.\n", pkt->size, head);
|
||||
return ff_raw_write_packet(s, pkt);
|
||||
}
|
||||
avpriv_mpegaudio_decode_header(&c, head);
|
||||
avpriv_mpegaudio_decode_header(&mpah, head);
|
||||
|
||||
if (!mp3->initial_bitrate)
|
||||
mp3->initial_bitrate = c.bit_rate;
|
||||
if ((c.bit_rate == 0) || (mp3->initial_bitrate != c.bit_rate))
|
||||
mp3->initial_bitrate = mpah.bit_rate;
|
||||
if ((mpah.bit_rate == 0) || (mp3->initial_bitrate != mpah.bit_rate))
|
||||
mp3->has_variable_bitrate = 1;
|
||||
|
||||
#ifdef FILTER_VBR_HEADERS
|
||||
/* filter out XING and INFO headers. */
|
||||
base = 4 + xing_offtbl[c.lsf == 1][c.nb_channels == 1];
|
||||
base = 4 + xing_offtbl[mpah.lsf == 1][mpah.nb_channels == 1];
|
||||
|
||||
if (base + 4 <= pkt->size) {
|
||||
uint32_t v = AV_RB32(pkt->data + base);
|
||||
|
||||
@@ -1370,7 +1370,7 @@ static void m4sl_cb(MpegTSFilter *filter, const uint8_t *section, int section_le
|
||||
AVStream *st;
|
||||
if (ts->pids[pid]->es_id != mp4_descr[i].es_id)
|
||||
continue;
|
||||
if (!(ts->pids[pid] && ts->pids[pid]->type == MPEGTS_PES)) {
|
||||
if (ts->pids[pid]->type != MPEGTS_PES) {
|
||||
av_log(s, AV_LOG_ERROR, "pid %x is not PES\n", pid);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -435,6 +435,12 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt)
|
||||
av_dlog(s, "compute_pkt_fields2: pts:%s dts:%s cur_dts:%s b:%d size:%d st:%d\n",
|
||||
av_ts2str(pkt->pts), av_ts2str(pkt->dts), av_ts2str(st->cur_dts), delay, pkt->size, pkt->stream_index);
|
||||
|
||||
if (pkt->duration < 0 && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) {
|
||||
av_log(s, AV_LOG_WARNING, "Packet with invalid duration %d in stream %d\n",
|
||||
pkt->duration, pkt->stream_index);
|
||||
pkt->duration = 0;
|
||||
}
|
||||
|
||||
/* duration field */
|
||||
if (pkt->duration == 0) {
|
||||
ff_compute_frame_duration(&num, &den, st, NULL, pkt);
|
||||
|
||||
@@ -293,7 +293,7 @@ static int oma_read_header(AVFormatContext *s)
|
||||
ID3v2ExtraMeta *extra_meta = NULL;
|
||||
OMAContext *oc = s->priv_data;
|
||||
|
||||
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_EA3_MAGIC, &extra_meta, 0);
|
||||
ret = avio_read(s->pb, buf, EA3_HEADER_SIZE);
|
||||
if (ret < EA3_HEADER_SIZE)
|
||||
return -1;
|
||||
@@ -448,7 +448,7 @@ static int oma_read_probe(AVProbeData *p)
|
||||
/* This check cannot overflow as tag_len has at most 28 bits */
|
||||
if (p->buf_size < tag_len + 5)
|
||||
/* EA3 header comes late, might be outside of the probe buffer */
|
||||
return tag_len ? AVPROBE_SCORE_EXTENSION : 0;
|
||||
return tag_len ? AVPROBE_SCORE_EXTENSION/2 : 0;
|
||||
|
||||
buf += tag_len;
|
||||
|
||||
|
||||
@@ -160,10 +160,6 @@ static int pmp_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
ret = av_get_packet(pb, pkt, pmp->packet_sizes[pmp->current_packet]);
|
||||
if (ret >= 0) {
|
||||
ret = 0;
|
||||
// FIXME: this is a hack that should be removed once
|
||||
// compute_pkt_fields() can handle timestamps properly
|
||||
if (pmp->cur_stream == 0)
|
||||
pkt->dts = s->streams[0]->cur_dts++;
|
||||
pkt->stream_index = pmp->cur_stream;
|
||||
}
|
||||
if (pmp->current_packet % pmp->audio_packets == 0)
|
||||
|
||||
+14
-1
@@ -150,6 +150,8 @@ static const uint8_t rtmp_server_key[] = {
|
||||
0xE6, 0x36, 0xCF, 0xEB, 0x31, 0xAE
|
||||
};
|
||||
|
||||
static int handle_chunk_size(URLContext *s, RTMPPacket *pkt);
|
||||
|
||||
static int add_tracked_method(RTMPContext *rt, const char *name, int id)
|
||||
{
|
||||
int err;
|
||||
@@ -408,6 +410,17 @@ static int read_connect(URLContext *s, RTMPContext *rt)
|
||||
if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
|
||||
&rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
|
||||
return ret;
|
||||
|
||||
if (pkt.type == RTMP_PT_CHUNK_SIZE) {
|
||||
if ((ret = handle_chunk_size(s, &pkt)) < 0)
|
||||
return ret;
|
||||
|
||||
ff_rtmp_packet_destroy(&pkt);
|
||||
if ((ret = ff_rtmp_packet_read(rt->stream, &pkt, rt->in_chunk_size,
|
||||
&rt->prev_pkt[0], &rt->nb_prev_pkt[0])) < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
cp = pkt.data;
|
||||
bytestream2_init(&gbc, cp, pkt.size);
|
||||
if (ff_amf_read_string(&gbc, command, sizeof(command), &stringlen)) {
|
||||
@@ -2556,7 +2569,7 @@ reconnect:
|
||||
if ((ret = gen_connect(s, rt)) < 0)
|
||||
goto fail;
|
||||
} else {
|
||||
if (read_connect(s, s->priv_data) < 0)
|
||||
if ((ret = read_connect(s, s->priv_data)) < 0)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
||||
+8
-5
@@ -564,7 +564,7 @@ int avformat_open_input(AVFormatContext **ps, const char *filename,
|
||||
|
||||
/* e.g. AVFMT_NOFILE formats will not have a AVIOContext */
|
||||
if (s->pb)
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta);
|
||||
ff_id3v2_read(s, ID3v2_DEFAULT_MAGIC, &id3v2_extra_meta, 0);
|
||||
|
||||
if (!(s->flags&AVFMT_FLAG_PRIV_OPT) && s->iformat->read_header)
|
||||
if ((ret = s->iformat->read_header(s)) < 0)
|
||||
@@ -2623,13 +2623,15 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
|
||||
if (!frame)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
if (!avcodec_is_open(st->codec) && !st->info->found_decoder) {
|
||||
if (!avcodec_is_open(st->codec) &&
|
||||
st->info->found_decoder <= 0 &&
|
||||
(st->codec->codec_id != -st->info->found_decoder || !st->codec->codec_id)) {
|
||||
AVDictionary *thread_opt = NULL;
|
||||
|
||||
codec = find_decoder(s, st, st->codec->codec_id);
|
||||
|
||||
if (!codec) {
|
||||
st->info->found_decoder = -1;
|
||||
st->info->found_decoder = -st->codec->codec_id;
|
||||
ret = -1;
|
||||
goto fail;
|
||||
}
|
||||
@@ -2641,7 +2643,7 @@ static int try_decode_frame(AVFormatContext *s, AVStream *st, AVPacket *avpkt,
|
||||
if (!options)
|
||||
av_dict_free(&thread_opt);
|
||||
if (ret < 0) {
|
||||
st->info->found_decoder = -1;
|
||||
st->info->found_decoder = -st->codec->codec_id;
|
||||
goto fail;
|
||||
}
|
||||
st->info->found_decoder = 1;
|
||||
@@ -3232,7 +3234,8 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
||||
}
|
||||
}
|
||||
#if FF_API_R_FRAME_RATE
|
||||
ff_rfps_add_frame(ic, st, pkt->dts);
|
||||
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
ff_rfps_add_frame(ic, st, pkt->dts);
|
||||
#endif
|
||||
if (st->parser && st->parser->parser->split && !st->codec->extradata) {
|
||||
int i = st->parser->parser->split(st->codec, pkt->data, pkt->size);
|
||||
|
||||
@@ -189,7 +189,7 @@ int avresample_open(AVAudioResampleContext *avr)
|
||||
}
|
||||
if (avr->resample_needed) {
|
||||
avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
|
||||
0, avr->internal_sample_fmt,
|
||||
1024, avr->internal_sample_fmt,
|
||||
"resample_out_buffer");
|
||||
if (!avr->resample_out_buffer) {
|
||||
ret = AVERROR(EINVAL);
|
||||
|
||||
@@ -58,8 +58,8 @@ ELF .size \name, . - \name
|
||||
|
||||
.macro movrel rd, val
|
||||
#if CONFIG_PIC
|
||||
adrp \rd, #:pg_hi21:\val
|
||||
add \rd, \rd, #:lo12:\val
|
||||
adrp \rd, :pg_hi21:\val
|
||||
add \rd, \rd, :lo12:\val
|
||||
#else
|
||||
ldr \rd, =\val
|
||||
#endif
|
||||
|
||||
@@ -331,15 +331,15 @@ int av_utf8_decode(int32_t *codep, const uint8_t **bufp, const uint8_t *buf_end,
|
||||
while (code & top) {
|
||||
int tmp;
|
||||
if (p >= buf_end) {
|
||||
ret = AVERROR(EILSEQ); /* incomplete sequence */
|
||||
goto end;
|
||||
(*bufp) ++;
|
||||
return AVERROR(EILSEQ); /* incomplete sequence */
|
||||
}
|
||||
|
||||
/* we assume the byte to be in the form 10xx-xxxx */
|
||||
tmp = *p++ - 128; /* strip leading 1 */
|
||||
if (tmp>>6) {
|
||||
ret = AVERROR(EILSEQ);
|
||||
goto end;
|
||||
(*bufp) ++;
|
||||
return AVERROR(EILSEQ);
|
||||
}
|
||||
code = (code<<6) + tmp;
|
||||
top <<= 5;
|
||||
|
||||
@@ -47,6 +47,26 @@
|
||||
static int flags, checked;
|
||||
|
||||
void av_force_cpu_flags(int arg){
|
||||
if ( (arg & ( AV_CPU_FLAG_3DNOW |
|
||||
AV_CPU_FLAG_3DNOWEXT |
|
||||
AV_CPU_FLAG_SSE |
|
||||
AV_CPU_FLAG_SSE2 |
|
||||
AV_CPU_FLAG_SSE2SLOW |
|
||||
AV_CPU_FLAG_SSE3 |
|
||||
AV_CPU_FLAG_SSE3SLOW |
|
||||
AV_CPU_FLAG_SSSE3 |
|
||||
AV_CPU_FLAG_SSE4 |
|
||||
AV_CPU_FLAG_SSE42 |
|
||||
AV_CPU_FLAG_AVX |
|
||||
AV_CPU_FLAG_XOP |
|
||||
AV_CPU_FLAG_FMA3 |
|
||||
AV_CPU_FLAG_FMA4 |
|
||||
AV_CPU_FLAG_AVX2 ))
|
||||
&& !(arg & AV_CPU_FLAG_MMX)) {
|
||||
av_log(NULL, AV_LOG_WARNING, "MMX implied by specified flags\n");
|
||||
arg |= AV_CPU_FLAG_MMX;
|
||||
}
|
||||
|
||||
flags = arg;
|
||||
checked = arg != -1;
|
||||
}
|
||||
|
||||
+4
-2
@@ -1599,8 +1599,10 @@ void av_opt_freep_ranges(AVOptionRanges **rangesp)
|
||||
|
||||
for (i = 0; i < ranges->nb_ranges; i++) {
|
||||
AVOptionRange *range = ranges->range[i];
|
||||
av_freep(&range->str);
|
||||
av_freep(&ranges->range[i]);
|
||||
if (range) {
|
||||
av_freep(&range->str);
|
||||
av_freep(&ranges->range[i]);
|
||||
}
|
||||
}
|
||||
av_freep(&ranges->range);
|
||||
av_freep(rangesp);
|
||||
|
||||
+1
-1
@@ -143,7 +143,7 @@ int ff_get_cpu_flags_x86(void)
|
||||
if (max_std_level >= 7) {
|
||||
cpuid(7, eax, ebx, ecx, edx);
|
||||
#if HAVE_AVX2
|
||||
if (ebx & 0x00000020)
|
||||
if ((rval & AV_CPU_FLAG_AVX) && (ebx & 0x00000020))
|
||||
rval |= AV_CPU_FLAG_AVX2;
|
||||
#endif /* HAVE_AVX2 */
|
||||
/* BMI1/2 don't need OS support */
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
void swri_get_dither(SwrContext *s, void *dst, int len, unsigned seed, enum AVSampleFormat noise_fmt) {
|
||||
double scale = s->dither.noise_scale;
|
||||
#define TMP_EXTRA 2
|
||||
double *tmp = av_malloc((len + TMP_EXTRA) * sizeof(double));
|
||||
double *tmp = av_malloc_array(len + TMP_EXTRA, sizeof(double));
|
||||
int i;
|
||||
|
||||
for(i=0; i<len + TMP_EXTRA; i++){
|
||||
|
||||
@@ -127,6 +127,11 @@ av_cold static int auto_matrix(SwrContext *s)
|
||||
)
|
||||
out_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if( in_ch_layout == AV_CH_LAYOUT_STEREO_DOWNMIX
|
||||
&& (out_ch_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == 0
|
||||
)
|
||||
in_ch_layout = AV_CH_LAYOUT_STEREO;
|
||||
|
||||
if(!sane_layout(in_ch_layout)){
|
||||
av_get_channel_layout_string(buf, sizeof(buf), -1, s->in_ch_layout);
|
||||
av_log(s, AV_LOG_ERROR, "Input channel layout '%s' is not supported\n", buf);
|
||||
|
||||
@@ -95,7 +95,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
|
||||
int filter_type, int kaiser_beta){
|
||||
int ph, i;
|
||||
double x, y, w;
|
||||
double *tab = av_malloc(tap_count * sizeof(*tab));
|
||||
double *tab = av_malloc_array(tap_count, sizeof(*tab));
|
||||
const int center= (tap_count-1)/2;
|
||||
|
||||
if (!tab)
|
||||
@@ -229,6 +229,11 @@ static ResampleContext *resample_init(ResampleContext *c, int out_rate, int in_r
|
||||
av_assert0(0);
|
||||
}
|
||||
|
||||
if (filter_size/factor > INT32_MAX/256) {
|
||||
av_log(NULL, AV_LOG_ERROR, "Filter length too large\n");
|
||||
goto error;
|
||||
}
|
||||
|
||||
c->phase_shift = phase_shift;
|
||||
c->phase_mask = phase_count - 1;
|
||||
c->linear = linear;
|
||||
|
||||
@@ -208,8 +208,9 @@ static void lumRangeToJpeg16_c(int16_t *_dst, int width)
|
||||
{
|
||||
int i;
|
||||
int32_t *dst = (int32_t *) _dst;
|
||||
for (i = 0; i < width; i++)
|
||||
dst[i] = (FFMIN(dst[i], 30189 << 4) * 4769 - (39057361 << 2)) >> 12;
|
||||
for (i = 0; i < width; i++) {
|
||||
dst[i] = ((int)(FFMIN(dst[i], 30189 << 4) * 4769U - (39057361 << 2))) >> 12;
|
||||
}
|
||||
}
|
||||
|
||||
static void lumRangeFromJpeg16_c(int16_t *_dst, int width)
|
||||
@@ -921,7 +922,7 @@ int attribute_align_arg sws_scale(struct SwsContext *c,
|
||||
uint8_t *dst2[4];
|
||||
uint8_t *rgb0_tmp = NULL;
|
||||
|
||||
if (!srcSlice || !dstStride || !dst || !srcSlice) {
|
||||
if (!srcStride || !dstStride || !dst || !srcSlice) {
|
||||
av_log(c, AV_LOG_ERROR, "One of the input parameters to sws_scale() is NULL, please check the calling code\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1585,7 +1585,7 @@ void ff_get_unscaled_swscale(SwsContext *c)
|
||||
c->swscale = ff_yuv2rgb_get_func_ptr(c);
|
||||
}
|
||||
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P &&
|
||||
if (srcFormat == AV_PIX_FMT_YUV410P && !(dstH & 3) &&
|
||||
(dstFormat == AV_PIX_FMT_YUV420P || dstFormat == AV_PIX_FMT_YUVA420P) &&
|
||||
!(flags & SWS_BITEXACT)) {
|
||||
c->swscale = yvu9ToYv12Wrapper;
|
||||
|
||||
+2
-2
@@ -367,7 +367,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
|
||||
int sizeFactor = -1;
|
||||
|
||||
for (i = 0; i < FF_ARRAY_ELEMS(scale_algorithms); i++) {
|
||||
if (flags & scale_algorithms[i].flag) {
|
||||
if (flags & scale_algorithms[i].flag && scale_algorithms[i].size_factor > 0) {
|
||||
sizeFactor = scale_algorithms[i].size_factor;
|
||||
break;
|
||||
}
|
||||
@@ -389,7 +389,7 @@ static av_cold int initFilter(int16_t **outFilter, int32_t **filterPos,
|
||||
|
||||
xDstInSrc = ((dstPos*(int64_t)xInc)>>7) - ((srcPos*0x10000LL)>>7);
|
||||
for (i = 0; i < dstW; i++) {
|
||||
int xx = (xDstInSrc - ((filterSize - 2) << 16)) / (1 << 17);
|
||||
int xx = (xDstInSrc - ((int64_t)(filterSize - 2) << 16)) / (1 << 17);
|
||||
int j;
|
||||
(*filterPos)[i] = xx;
|
||||
for (j = 0; j < filterSize; j++) {
|
||||
|
||||
@@ -332,7 +332,7 @@ static void RENAME(yuv2yuvX)(const int16_t *filter, int filterSize,
|
||||
MOVNTQ( q3, 24(dst, index, 4))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t) REAL_WRITEBGR32(dst, dstw, index, b, g, r, a, q0, q2, q3, t)
|
||||
|
||||
@@ -358,13 +358,13 @@ static void RENAME(yuv2rgb32_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm3, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm2, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
} else {
|
||||
YSCALEYUV2PACKEDX_ACCURATE
|
||||
YSCALEYUV2RGBX
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
}
|
||||
@@ -387,13 +387,13 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
} else {
|
||||
YSCALEYUV2PACKEDX
|
||||
YSCALEYUV2RGBX
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%4, %5, %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, "%5", %%REGa, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
}
|
||||
@@ -422,7 +422,7 @@ static void RENAME(yuv2rgb32_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm1, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB16(dst, dstw, index) REAL_WRITERGB16(dst, dstw, index)
|
||||
|
||||
@@ -446,7 +446,7 @@ static void RENAME(yuv2rgb565_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
|
||||
#endif
|
||||
WRITERGB16(%4, %5, %%REGa)
|
||||
WRITERGB16(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -470,7 +470,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%4, %5, %%REGa)
|
||||
WRITERGB16(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -499,7 +499,7 @@ static void RENAME(yuv2rgb565_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm1, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITERGB15(dst, dstw, index) REAL_WRITERGB15(dst, dstw, index)
|
||||
|
||||
@@ -523,7 +523,7 @@ static void RENAME(yuv2rgb555_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4\n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5\n\t"
|
||||
#endif
|
||||
WRITERGB15(%4, %5, %%REGa)
|
||||
WRITERGB15(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -547,7 +547,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"paddusb "GREEN_DITHER"(%0), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%0), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%4, %5, %%REGa)
|
||||
WRITERGB15(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -601,7 +601,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"add $24, "#dst" \n\t"\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
|
||||
#define WRITEBGR24MMXEXT(dst, dstw, index) \
|
||||
@@ -649,7 +649,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"add $24, "#dst" \n\t"\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
|
||||
#if COMPILE_TEMPLATE_MMXEXT
|
||||
@@ -676,7 +676,7 @@ static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c"\n\t" //FIXME optimize
|
||||
"add %4, %%"REG_c" \n\t"
|
||||
WRITEBGR24(%%REGc, %5, %%REGa)
|
||||
WRITEBGR24(%%REGc, "%5", %%REGa)
|
||||
:: "r" (&c->redDither),
|
||||
"m" (dummy), "m" (dummy), "m" (dummy),
|
||||
"r" (dest), "m" (dstW_reg), "m"(uv_off)
|
||||
@@ -700,7 +700,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
"lea (%%"REG_a", %%"REG_a", 2), %%"REG_c" \n\t" //FIXME optimize
|
||||
"add %4, %%"REG_c" \n\t"
|
||||
WRITEBGR24(%%REGc, %5, %%REGa)
|
||||
WRITEBGR24(%%REGc, "%5", %%REGa)
|
||||
:: "r" (&c->redDither),
|
||||
"m" (dummy), "m" (dummy), "m" (dummy),
|
||||
"r" (dest), "m" (dstW_reg), "m"(uv_off)
|
||||
@@ -721,7 +721,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
MOVNTQ(%%mm7, 8(dst, index, 2))\
|
||||
\
|
||||
"add $8, "#index" \n\t"\
|
||||
"cmp "#dstw", "#index" \n\t"\
|
||||
"cmp "dstw", "#index" \n\t"\
|
||||
" jb 1b \n\t"
|
||||
#define WRITEYUY2(dst, dstw, index) REAL_WRITEYUY2(dst, dstw, index)
|
||||
|
||||
@@ -742,7 +742,7 @@ static void RENAME(yuv2yuyv422_X_ar)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm4 \n\t"
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
WRITEYUY2(%4, %5, %%REGa)
|
||||
WRITEYUY2(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -763,7 +763,7 @@ static void RENAME(yuv2yuyv422_X)(SwsContext *c, const int16_t *lumFilter,
|
||||
"psraw $3, %%mm4 \n\t"
|
||||
"psraw $3, %%mm1 \n\t"
|
||||
"psraw $3, %%mm7 \n\t"
|
||||
WRITEYUY2(%4, %5, %%REGa)
|
||||
WRITEYUY2(%4, "%5", %%REGa)
|
||||
YSCALEYUV2PACKEDX_END
|
||||
}
|
||||
|
||||
@@ -864,7 +864,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"psraw $3, %%mm1 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
|
||||
"psraw $3, %%mm7 \n\t" /* abuf0[eax] - abuf1[eax] >>7*/
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
WRITEBGR32(%4, 8280(%5), %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%4, DSTW_OFFSET"(%5)", %%r8, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "r" (dest),
|
||||
"a" (&c->redDither),
|
||||
"r" (abuf0), "r" (abuf1)
|
||||
@@ -888,7 +888,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"packuswb %%mm7, %%mm1 \n\t"
|
||||
"pop %1 \n\t"
|
||||
"pop %0 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm1, %%mm0, %%mm7, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -902,7 +902,7 @@ static void RENAME(yuv2rgb32_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -919,14 +919,13 @@ static void RENAME(yuv2bgr24_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -942,7 +941,6 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
@@ -955,7 +953,7 @@ static void RENAME(yuv2rgb555_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -971,7 +969,6 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
@@ -984,7 +981,7 @@ static void RENAME(yuv2rgb565_2)(SwsContext *c, const int16_t *buf[2],
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1040,13 +1037,12 @@ static void RENAME(yuv2yuyv422_2)(SwsContext *c, const int16_t *buf[2],
|
||||
const int16_t *buf0 = buf[0], *buf1 = buf[1],
|
||||
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1];
|
||||
|
||||
//Note 8280 == DSTW_OFFSET but the preprocessor can't handle that there :(
|
||||
__asm__ volatile(
|
||||
"mov %%"REG_b", "ESP_OFFSET"(%5) \n\t"
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1189,7 +1185,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
YSCALEYUV2RGB1_ALPHA(%%REGBP)
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1202,7 +1198,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1218,7 +1214,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
YSCALEYUV2RGB1_ALPHA(%%REGBP)
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (abuf0), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1231,7 +1227,7 @@ static void RENAME(yuv2rgb32_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
"pcmpeqd %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR32(%%REGb, 8280(%5), %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
WRITEBGR32(%%REGb, DSTW_OFFSET"(%5)", %%REGBP, %%mm2, %%mm4, %%mm5, %%mm7, %%mm0, %%mm1, %%mm3, %%mm6)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1257,7 +1253,7 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1271,7 +1267,7 @@ static void RENAME(yuv2bgr24_1)(SwsContext *c, const int16_t *buf0,
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2RGB1b(%%REGBP, %5)
|
||||
"pxor %%mm7, %%mm7 \n\t"
|
||||
WRITEBGR24(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEBGR24(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1302,7 +1298,7 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1322,7 +1318,7 @@ static void RENAME(yuv2rgb555_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB15(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB15(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1353,7 +1349,7 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1373,7 +1369,7 @@ static void RENAME(yuv2rgb565_1)(SwsContext *c, const int16_t *buf0,
|
||||
"paddusb "GREEN_DITHER"(%5), %%mm4 \n\t"
|
||||
"paddusb "RED_DITHER"(%5), %%mm5 \n\t"
|
||||
#endif
|
||||
WRITERGB16(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITERGB16(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1434,7 +1430,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED1(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
@@ -1447,7 +1443,7 @@ static void RENAME(yuv2yuyv422_1)(SwsContext *c, const int16_t *buf0,
|
||||
"mov %4, %%"REG_b" \n\t"
|
||||
"push %%"REG_BP" \n\t"
|
||||
YSCALEYUV2PACKED1b(%%REGBP, %5)
|
||||
WRITEYUY2(%%REGb, 8280(%5), %%REGBP)
|
||||
WRITEYUY2(%%REGb, DSTW_OFFSET"(%5)", %%REGBP)
|
||||
"pop %%"REG_BP" \n\t"
|
||||
"mov "ESP_OFFSET"(%5), %%"REG_b" \n\t"
|
||||
:: "c" (buf0), "d" (buf1), "S" (ubuf0), "D" (ubuf1), "m" (dest),
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
pkt_pts=1620|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.880000
|
||||
pkt_pts=4140|tag:lavfi.scene_score=0.876043
|
||||
pkt_pts=5800|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.460000
|
||||
pkt_pts=6720|tag:lavfi.scene_score=0.463259
|
||||
pkt_pts=8160|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=9760|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.840000
|
||||
pkt_pts=14080|tag:lavfi.scene_score=0.841420
|
||||
pkt_pts=15700|tag:lavfi.scene_score=1.000000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.470000
|
||||
pkt_pts=18500|tag:lavfi.scene_score=0.471738
|
||||
pkt_pts=21760|tag:lavfi.scene_score=1.000000
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user