Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e3096771
Commit
e3096771
authored
Sep 01, 2012
by
Stephan Hilb
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://source.ffmpeg.org/ffmpeg
parents
296140eb
d55252c3
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
139 additions
and
233 deletions
+139
-233
configure
configure
+2
-0
filtering_audio.c
doc/examples/filtering_audio.c
+1
-1
filtering_video.c
doc/examples/filtering_video.c
+1
-1
filters.texi
doc/filters.texi
+0
-1
ffmpeg_filter.c
ffmpeg_filter.c
+3
-3
ffplay.c
ffplay.c
+1
-1
avcodec.h
libavcodec/avcodec.h
+16
-5
dvbsubdec.c
libavcodec/dvbsubdec.c
+4
-0
imgconvert.c
libavcodec/imgconvert.c
+17
-3
lavfi.c
libavdevice/lavfi.c
+2
-2
Makefile
libavfilter/Makefile
+0
-1
allfilters.c
libavfilter/allfilters.c
+6
-0
avfiltergraph.c
libavfilter/avfiltergraph.c
+2
-2
buffersink.c
libavfilter/buffersink.c
+8
-0
vf_decimate.c
libavfilter/libmpcodecs/vf_decimate.c
+0
-198
sink_buffer.c
libavfilter/sink_buffer.c
+43
-3
version.h
libavfilter/version.h
+1
-1
vf_mp.c
libavfilter/vf_mp.c
+0
-2
filmstripdec.c
libavformat/filmstripdec.c
+1
-1
flic.c
libavformat/flic.c
+1
-1
matroskadec.c
libavformat/matroskadec.c
+21
-2
matroskaenc.c
libavformat/matroskaenc.c
+4
-1
srtenc.c
libavformat/srtenc.c
+1
-0
wtvdec.c
libavformat/wtvdec.c
+1
-1
resample.c
libswresample/resample.c
+2
-2
utvideo.mak
tests/fate/utvideo.mak
+1
-1
No files found.
configure
View file @
e3096771
...
...
@@ -1114,6 +1114,7 @@ CONFIG_LIST="
gpl
gray
hardcoded_tables
incompatible_fork_abi
libaacplus
libass
libbluray
...
...
@@ -1248,6 +1249,7 @@ ARCH_EXT_LIST="
HAVE_LIST_PUB
=
'
bigendian
fast_unaligned
incompatible_fork_abi
'
HAVE_LIST
=
"
...
...
doc/examples/filtering_audio.c
View file @
e3096771
...
...
@@ -84,7 +84,7 @@ static int init_filters(const char *filters_descr)
char
args
[
512
];
int
ret
;
AVFilter
*
abuffersrc
=
avfilter_get_by_name
(
"abuffer"
);
AVFilter
*
abuffersink
=
avfilter_get_by_name
(
"abuffersink"
);
AVFilter
*
abuffersink
=
avfilter_get_by_name
(
"
ff
abuffersink"
);
AVFilterInOut
*
outputs
=
avfilter_inout_alloc
();
AVFilterInOut
*
inputs
=
avfilter_inout_alloc
();
const
enum
AVSampleFormat
sample_fmts
[]
=
{
AV_SAMPLE_FMT_S16
,
-
1
};
...
...
doc/examples/filtering_video.c
View file @
e3096771
...
...
@@ -84,7 +84,7 @@ static int init_filters(const char *filters_descr)
char
args
[
512
];
int
ret
;
AVFilter
*
buffersrc
=
avfilter_get_by_name
(
"buffer"
);
AVFilter
*
buffersink
=
avfilter_get_by_name
(
"buffersink"
);
AVFilter
*
buffersink
=
avfilter_get_by_name
(
"
ff
buffersink"
);
AVFilterInOut
*
outputs
=
avfilter_inout_alloc
();
AVFilterInOut
*
inputs
=
avfilter_inout_alloc
();
enum
PixelFormat
pix_fmts
[]
=
{
PIX_FMT_GRAY8
,
PIX_FMT_NONE
};
...
...
doc/filters.texi
View file @
e3096771
...
...
@@ -2508,7 +2508,6 @@ the named filter.
The list of the currently supported filters follows:
@table @var
@item decimate
@item denoise3d
@item detc
@item dint
...
...
ffmpeg_filter.c
View file @
e3096771
...
...
@@ -48,7 +48,7 @@ enum PixelFormat choose_pixel_fmt(AVStream *st, AVCodec *codec, enum PixelFormat
}
}
for
(;
*
p
!=
PIX_FMT_NONE
;
p
++
)
{
best
=
avcodec_find_best_pix_fmt2
(
best
,
*
p
,
target
,
has_alpha
,
NULL
);
best
=
avcodec_find_best_pix_fmt
_of_
2
(
best
,
*
p
,
target
,
has_alpha
,
NULL
);
if
(
*
p
==
target
)
break
;
}
...
...
@@ -294,7 +294,7 @@ static int configure_output_video_filter(FilterGraph *fg, OutputFilter *ofilter,
snprintf
(
name
,
sizeof
(
name
),
"output stream %d:%d"
,
ost
->
file_index
,
ost
->
index
);
ret
=
avfilter_graph_create_filter
(
&
ofilter
->
filter
,
avfilter_get_by_name
(
"buffersink"
),
avfilter_get_by_name
(
"
ff
buffersink"
),
name
,
NULL
,
NULL
/*buffersink_params*/
,
fg
->
graph
);
av_freep
(
&
buffersink_params
);
...
...
@@ -377,7 +377,7 @@ static int configure_output_audio_filter(FilterGraph *fg, OutputFilter *ofilter,
snprintf
(
name
,
sizeof
(
name
),
"output stream %d:%d"
,
ost
->
file_index
,
ost
->
index
);
ret
=
avfilter_graph_create_filter
(
&
ofilter
->
filter
,
avfilter_get_by_name
(
"abuffersink"
),
avfilter_get_by_name
(
"
ff
abuffersink"
),
name
,
NULL
,
NULL
,
fg
->
graph
);
if
(
ret
<
0
)
return
ret
;
...
...
ffplay.c
View file @
e3096771
...
...
@@ -1606,7 +1606,7 @@ static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const c
buffersink_params
->
pixel_fmts
=
pix_fmts
;
ret
=
avfilter_graph_create_filter
(
&
filt_out
,
avfilter_get_by_name
(
"buffersink"
),
avfilter_get_by_name
(
"
ff
buffersink"
),
"ffplay_buffersink"
,
NULL
,
buffersink_params
,
graph
);
av_freep
(
&
buffersink_params
);
if
(
ret
<
0
)
...
...
libavcodec/avcodec.h
View file @
e3096771
...
...
@@ -4512,7 +4512,7 @@ int avcodec_get_pix_fmt_loss(enum PixelFormat dst_pix_fmt, enum PixelFormat src_
#if FF_API_FIND_BEST_PIX_FMT
/**
* @deprecated use avcodec_find_best_pix_fmt2() instead.
* @deprecated use avcodec_find_best_pix_fmt
_of_
2() instead.
*
* Find the best pixel format to convert to given a certain source pixel
* format. When converting from one pixel format to another, information loss
...
...
@@ -4547,7 +4547,7 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
* format. When converting from one pixel format to another, information loss
* may occur. For example, when converting from RGB24 to GRAY, the color
* information will be lost. Similarly, other losses occur when converting from
* some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
* some formats to other formats. avcodec_find_best_pix_fmt
_of_
2() searches which of
* the given pixel formats should be used to suffer the least amount of loss.
* The pixel formats from which it chooses one, are determined by the
* pix_fmt_list parameter.
...
...
@@ -4568,7 +4568,7 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* format and a selection of two destination pixel formats. When converting from
* one pixel format to another, information loss may occur. For example, when converting
* from RGB24 to GRAY, the color information will be lost. Similarly, other losses occur when
* converting from some formats to other formats. avcodec_find_best_pix_fmt2() selects which of
* converting from some formats to other formats. avcodec_find_best_pix_fmt
_of_
2() selects which of
* the given pixel formats should be used to suffer the least amount of loss.
*
* If one of the destination formats is PIX_FMT_NONE the other pixel format (if valid) will be
...
...
@@ -4580,8 +4580,8 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* dst_pix_fmt2= PIX_FMT_GRAY8;
* dst_pix_fmt3= PIX_FMT_RGB8;
* loss= FF_LOSS_CHROMA; // don't care about chroma loss, so chroma loss will be ignored.
* dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
* dst_pix_fmt = avcodec_find_best_pix_fmt2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
* dst_pix_fmt = avcodec_find_best_pix_fmt
_of_
2(dst_pix_fmt1, dst_pix_fmt2, src_pix_fmt, alpha, &loss);
* dst_pix_fmt = avcodec_find_best_pix_fmt
_of_
2(dst_pix_fmt, dst_pix_fmt3, src_pix_fmt, alpha, &loss);
* @endcode
*
* @param[in] dst_pix_fmt1 One of the two destination pixel formats to choose from
...
...
@@ -4593,8 +4593,19 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
* that occurs when converting from src to selected dst pixel format.
* @return The best pixel format to convert to or -1 if none was found.
*/
enum
PixelFormat
avcodec_find_best_pix_fmt_of_2
(
enum
PixelFormat
dst_pix_fmt1
,
enum
PixelFormat
dst_pix_fmt2
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
);
attribute_deprecated
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum
PixelFormat
avcodec_find_best_pix_fmt2
(
enum
PixelFormat
*
pix_fmt_list
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
);
#else
enum
PixelFormat
avcodec_find_best_pix_fmt2
(
enum
PixelFormat
dst_pix_fmt1
,
enum
PixelFormat
dst_pix_fmt2
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
);
#endif
enum
PixelFormat
avcodec_default_get_format
(
struct
AVCodecContext
*
s
,
const
enum
PixelFormat
*
fmt
);
...
...
libavcodec/dvbsubdec.c
View file @
e3096771
...
...
@@ -1343,6 +1343,10 @@ static void dvbsub_parse_display_definition_segment(AVCodecContext *avctx,
display_def
->
y
=
0
;
display_def
->
width
=
bytestream_get_be16
(
&
buf
)
+
1
;
display_def
->
height
=
bytestream_get_be16
(
&
buf
)
+
1
;
if
(
!
avctx
->
width
||
!
avctx
->
height
)
{
avctx
->
width
=
display_def
->
width
;
avctx
->
height
=
display_def
->
height
;
}
if
(
buf_size
<
13
)
return
;
...
...
libavcodec/imgconvert.c
View file @
e3096771
...
...
@@ -529,13 +529,13 @@ enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelForma
dst_pix_fmt
=
PIX_FMT_NONE
;
/* so first iteration doesn't have to be treated special */
for
(
i
=
0
;
i
<
FFMIN
(
PIX_FMT_NB
,
64
);
i
++
){
if
(
pix_fmt_mask
&
(
1ULL
<<
i
))
dst_pix_fmt
=
avcodec_find_best_pix_fmt2
(
dst_pix_fmt
,
i
,
src_pix_fmt
,
has_alpha
,
loss_ptr
);
dst_pix_fmt
=
avcodec_find_best_pix_fmt
_of_
2
(
dst_pix_fmt
,
i
,
src_pix_fmt
,
has_alpha
,
loss_ptr
);
}
return
dst_pix_fmt
;
}
#endif
/* FF_API_FIND_BEST_PIX_FMT */
enum
PixelFormat
avcodec_find_best_pix_fmt2
(
enum
PixelFormat
dst_pix_fmt1
,
enum
PixelFormat
dst_pix_fmt2
,
enum
PixelFormat
avcodec_find_best_pix_fmt
_of_
2
(
enum
PixelFormat
dst_pix_fmt1
,
enum
PixelFormat
dst_pix_fmt2
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
)
{
enum
PixelFormat
dst_pix_fmt
;
...
...
@@ -577,6 +577,20 @@ enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat dst_pix_fmt1, enum
return
dst_pix_fmt
;
}
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
enum
PixelFormat
avcodec_find_best_pix_fmt2
(
enum
PixelFormat
*
pix_fmt_list
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
){
return
avcodec_find_best_pix_fmt_of_list
(
pix_fmt_list
,
src_pix_fmt
,
has_alpha
,
loss_ptr
);
}
#else
enum
PixelFormat
avcodec_find_best_pix_fmt2
(
enum
PixelFormat
dst_pix_fmt1
,
enum
PixelFormat
dst_pix_fmt2
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
)
{
return
avcodec_find_best_pix_fmt_of_2
(
dst_pix_fmt1
,
dst_pix_fmt2
,
src_pix_fmt
,
has_alpha
,
loss_ptr
);
}
#endif
enum
PixelFormat
avcodec_find_best_pix_fmt_of_list
(
enum
PixelFormat
*
pix_fmt_list
,
enum
PixelFormat
src_pix_fmt
,
int
has_alpha
,
int
*
loss_ptr
){
...
...
@@ -585,7 +599,7 @@ enum PixelFormat avcodec_find_best_pix_fmt_of_list(enum PixelFormat *pix_fmt_lis
enum
PixelFormat
best
=
PIX_FMT_NONE
;
for
(
i
=
0
;
pix_fmt_list
[
i
]
!=
PIX_FMT_NONE
;
i
++
)
best
=
avcodec_find_best_pix_fmt2
(
best
,
pix_fmt_list
[
i
],
src_pix_fmt
,
has_alpha
,
loss_ptr
);
best
=
avcodec_find_best_pix_fmt
_of_
2
(
best
,
pix_fmt_list
[
i
],
src_pix_fmt
,
has_alpha
,
loss_ptr
);
return
best
;
}
...
...
libavdevice/lavfi.c
View file @
e3096771
...
...
@@ -95,8 +95,8 @@ av_cold static int lavfi_read_header(AVFormatContext *avctx)
avfilter_register_all
();
buffersink
=
avfilter_get_by_name
(
"buffersink"
);
abuffersink
=
avfilter_get_by_name
(
"abuffersink"
);
buffersink
=
avfilter_get_by_name
(
"
ff
buffersink"
);
abuffersink
=
avfilter_get_by_name
(
"
ff
abuffersink"
);
if
(
!
lavfi
->
graph_str
)
lavfi
->
graph_str
=
av_strdup
(
avctx
->
filename
);
...
...
libavfilter/Makefile
View file @
e3096771
...
...
@@ -156,7 +156,6 @@ OBJS-$(CONFIG_NULLSINK_FILTER) += vsink_nullsink.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/mp_image.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/img_format.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/vf_decimate.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/vf_denoise3d.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/vf_detc.o
OBJS-$(CONFIG_MP_FILTER)
+=
libmpcodecs/vf_dint.o
...
...
libavfilter/allfilters.c
View file @
e3096771
...
...
@@ -64,8 +64,11 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
ANULLSRC
,
anullsrc
,
asrc
);
REGISTER_FILTER
(
FLITE
,
flite
,
asrc
);
#if !AV_HAVE_INCOMPATIBLE_FORK_ABI
REGISTER_FILTER
(
ABUFFERSINK
,
abuffersink
,
asink
);
#endif
REGISTER_FILTER
(
ANULLSINK
,
anullsink
,
asink
);
REGISTER_FILTER
(
FFABUFFERSINK
,
ffabuffersink
,
asink
);
REGISTER_FILTER
(
ALPHAEXTRACT
,
alphaextract
,
vf
);
REGISTER_FILTER
(
ALPHAMERGE
,
alphamerge
,
vf
);
...
...
@@ -140,7 +143,10 @@ void avfilter_register_all(void)
REGISTER_FILTER
(
SMPTEBARS
,
smptebars
,
vsrc
);
REGISTER_FILTER
(
TESTSRC
,
testsrc
,
vsrc
);
#if !AV_HAVE_INCOMPATIBLE_FORK_ABI
REGISTER_FILTER
(
BUFFERSINK
,
buffersink
,
vsink
);
#endif
REGISTER_FILTER
(
FFBUFFERSINK
,
ffbuffersink
,
vsink
);
REGISTER_FILTER
(
NULLSINK
,
nullsink
,
vsink
);
/* multimedia filters */
...
...
libavfilter/avfiltergraph.c
View file @
e3096771
...
...
@@ -26,7 +26,7 @@
#include "libavutil/audioconvert.h"
#include "libavutil/avassert.h"
#include "libavutil/pixdesc.h"
#include "libavcodec/avcodec.h" // avcodec_find_best_pix_fmt2()
#include "libavcodec/avcodec.h" // avcodec_find_best_pix_fmt
_of_
2()
#include "avfilter.h"
#include "avfiltergraph.h"
#include "formats.h"
...
...
@@ -429,7 +429,7 @@ static int pick_format(AVFilterLink *link, AVFilterLink *ref)
int
i
;
for
(
i
=
0
;
i
<
link
->
in_formats
->
format_count
;
i
++
)
{
enum
PixelFormat
p
=
link
->
in_formats
->
formats
[
i
];
best
=
avcodec_find_best_pix_fmt2
(
best
,
p
,
ref
->
format
,
has_alpha
,
NULL
);
best
=
avcodec_find_best_pix_fmt
_of_
2
(
best
,
p
,
ref
->
format
,
has_alpha
,
NULL
);
}
av_log
(
link
->
src
,
AV_LOG_DEBUG
,
"picking %s out of %d ref:%s alpha:%d
\n
"
,
av_get_pix_fmt_name
(
best
),
link
->
in_formats
->
format_count
,
...
...
libavfilter/buffersink.c
View file @
e3096771
...
...
@@ -141,7 +141,11 @@ int av_buffersink_read_samples(AVFilterContext *ctx, AVFilterBufferRef **pbuf,
}
AVFilter
avfilter_vsink_buffer
=
{
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
.
name
=
"buffersink"
,
#else
.
name
=
"buffersink_old"
,
#endif
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer video frames, and make them available to the end of the filter graph."
),
.
priv_size
=
sizeof
(
BufferSinkContext
),
.
uninit
=
uninit
,
...
...
@@ -156,7 +160,11 @@ AVFilter avfilter_vsink_buffer = {
};
AVFilter
avfilter_asink_abuffer
=
{
#if AV_HAVE_INCOMPATIBLE_FORK_ABI
.
name
=
"abuffersink"
,
#else
.
name
=
"abuffersink_old"
,
#endif
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer audio frames, and make them available to the end of the filter graph."
),
.
priv_size
=
sizeof
(
BufferSinkContext
),
.
uninit
=
uninit
,
...
...
libavfilter/libmpcodecs/vf_decimate.c
deleted
100644 → 0
View file @
296140eb
/*
* This file is part of MPlayer.
*
* MPlayer is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* MPlayer is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with MPlayer; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "mp_msg.h"
#include "cpudetect.h"
#include "img_format.h"
#include "mp_image.h"
#include "vf.h"
#include "libvo/fastmemcpy.h"
struct
vf_priv_s
{
int
hi
,
lo
;
float
frac
;
int
max
,
last
,
cnt
;
};
#if HAVE_MMX && HAVE_EBX_AVAILABLE
static
int
diff_MMX
(
unsigned
char
*
old
,
unsigned
char
*
new
,
int
os
,
int
ns
)
{
volatile
short
out
[
4
];
__asm__
(
"movl $8, %%ecx
\n\t
"
"pxor %%mm4, %%mm4
\n\t
"
"pxor %%mm7, %%mm7
\n\t
"
ASMALIGN
(
4
)
"1:
\n\t
"
"movq (%%"
REG_S
"), %%mm0
\n\t
"
"movq (%%"
REG_S
"), %%mm2
\n\t
"
"add %%"
REG_a
", %%"
REG_S
"
\n\t
"
"movq (%%"
REG_D
"), %%mm1
\n\t
"
"add %%"
REG_b
", %%"
REG_D
"
\n\t
"
"psubusb %%mm1, %%mm2
\n\t
"
"psubusb %%mm0, %%mm1
\n\t
"
"movq %%mm2, %%mm0
\n\t
"
"movq %%mm1, %%mm3
\n\t
"
"punpcklbw %%mm7, %%mm0
\n\t
"
"punpcklbw %%mm7, %%mm1
\n\t
"
"punpckhbw %%mm7, %%mm2
\n\t
"
"punpckhbw %%mm7, %%mm3
\n\t
"
"paddw %%mm0, %%mm4
\n\t
"
"paddw %%mm1, %%mm4
\n\t
"
"paddw %%mm2, %%mm4
\n\t
"
"paddw %%mm3, %%mm4
\n\t
"
"decl %%ecx
\n\t
"
"jnz 1b
\n\t
"
"movq %%mm4, (%%"
REG_d
")
\n\t
"
"emms
\n\t
"
:
:
"S"
(
old
),
"D"
(
new
),
"a"
((
long
)
os
),
"b"
((
long
)
ns
),
"d"
(
out
)
:
"%ecx"
,
"memory"
);
return
out
[
0
]
+
out
[
1
]
+
out
[
2
]
+
out
[
3
];
}
#endif
static
int
diff_C
(
unsigned
char
*
old
,
unsigned
char
*
new
,
int
os
,
int
ns
)
{
int
x
,
y
,
d
=
0
;
for
(
y
=
0
;
y
<
8
;
y
++
)
{
for
(
x
=
0
;
x
<
8
;
x
++
)
{
d
+=
abs
(
new
[
x
]
-
old
[
x
]);
}
new
+=
ns
;
old
+=
os
;
}
return
d
;
}
static
int
(
*
diff
)(
unsigned
char
*
,
unsigned
char
*
,
int
,
int
);
static
int
diff_to_drop_plane
(
int
hi
,
int
lo
,
float
frac
,
unsigned
char
*
old
,
unsigned
char
*
new
,
int
w
,
int
h
,
int
os
,
int
ns
)
{
int
x
,
y
;
int
d
,
c
=
0
;
int
t
=
(
w
/
16
)
*
(
h
/
16
)
*
frac
;
for
(
y
=
0
;
y
<
h
-
7
;
y
+=
4
)
{
for
(
x
=
8
;
x
<
w
-
7
;
x
+=
4
)
{
d
=
diff
(
old
+
x
+
y
*
os
,
new
+
x
+
y
*
ns
,
os
,
ns
);
if
(
d
>
hi
)
return
0
;
if
(
d
>
lo
)
{
c
++
;
if
(
c
>
t
)
return
0
;
}
}
}
return
1
;
}
static
int
diff_to_drop
(
int
hi
,
int
lo
,
float
frac
,
mp_image_t
*
old
,
mp_image_t
*
new
)
{
if
(
new
->
flags
&
MP_IMGFLAG_PLANAR
)
{
return
diff_to_drop_plane
(
hi
,
lo
,
frac
,
old
->
planes
[
0
],
new
->
planes
[
0
],
new
->
w
,
new
->
h
,
old
->
stride
[
0
],
new
->
stride
[
0
])
&&
diff_to_drop_plane
(
hi
,
lo
,
frac
,
old
->
planes
[
1
],
new
->
planes
[
1
],
new
->
chroma_width
,
new
->
chroma_height
,
old
->
stride
[
1
],
new
->
stride
[
1
])
&&
diff_to_drop_plane
(
hi
,
lo
,
frac
,
old
->
planes
[
2
],
new
->
planes
[
2
],
new
->
chroma_width
,
new
->
chroma_height
,
old
->
stride
[
2
],
new
->
stride
[
2
]);
}
return
diff_to_drop_plane
(
hi
,
lo
,
frac
,
old
->
planes
[
0
],
new
->
planes
[
0
],
new
->
w
*
(
new
->
bpp
/
8
),
new
->
h
,
old
->
stride
[
0
],
new
->
stride
[
0
]);
}
static
int
put_image
(
struct
vf_instance
*
vf
,
mp_image_t
*
mpi
,
double
pts
)
{
mp_image_t
*
dmpi
;
dmpi
=
vf_get_image
(
vf
->
next
,
mpi
->
imgfmt
,
MP_IMGTYPE_STATIC
,
MP_IMGFLAG_ACCEPT_STRIDE
|
MP_IMGFLAG_PRESERVE
|
MP_IMGFLAG_READABLE
,
mpi
->
width
,
mpi
->
height
);
dmpi
->
qscale
=
mpi
->
qscale
;
dmpi
->
qstride
=
mpi
->
qstride
;
dmpi
->
qscale_type
=
mpi
->
qscale_type
;
if
(
diff_to_drop
(
vf
->
priv
->
hi
,
vf
->
priv
->
lo
,
vf
->
priv
->
frac
,
dmpi
,
mpi
))
{
if
(
vf
->
priv
->
max
==
0
)
return
0
;
else
if
((
vf
->
priv
->
max
>
0
)
&&
(
vf
->
priv
->
cnt
++
<
vf
->
priv
->
max
))
return
0
;
else
if
((
vf
->
priv
->
max
<
0
)
&&
(
vf
->
priv
->
last
+
1
>=
-
vf
->
priv
->
max
))
return
vf
->
priv
->
last
=
0
;
}
vf
->
priv
->
last
++
;
vf
->
priv
->
cnt
=
0
;
memcpy_pic
(
dmpi
->
planes
[
0
],
mpi
->
planes
[
0
],
mpi
->
w
,
mpi
->
h
,
dmpi
->
stride
[
0
],
mpi
->
stride
[
0
]);
if
(
mpi
->
flags
&
MP_IMGFLAG_PLANAR
)
{
memcpy_pic
(
dmpi
->
planes
[
1
],
mpi
->
planes
[
1
],
mpi
->
chroma_width
,
mpi
->
chroma_height
,
dmpi
->
stride
[
1
],
mpi
->
stride
[
1
]);
memcpy_pic
(
dmpi
->
planes
[
2
],
mpi
->
planes
[
2
],
mpi
->
chroma_width
,
mpi
->
chroma_height
,
dmpi
->
stride
[
2
],
mpi
->
stride
[
2
]);
}
return
vf_next_put_image
(
vf
,
dmpi
,
pts
);
}
static
void
uninit
(
struct
vf_instance
*
vf
)
{
free
(
vf
->
priv
);
}
static
int
vf_open
(
vf_instance_t
*
vf
,
char
*
args
)
{
struct
vf_priv_s
*
p
;
vf
->
put_image
=
put_image
;
vf
->
uninit
=
uninit
;
vf
->
default_reqs
=
VFCAP_ACCEPT_STRIDE
;
vf
->
priv
=
p
=
calloc
(
1
,
sizeof
(
struct
vf_priv_s
));
p
->
max
=
0
;
p
->
hi
=
64
*
12
;
p
->
lo
=
64
*
5
;
p
->
frac
=
0
.
33
;
if
(
args
)
sscanf
(
args
,
"%d:%d:%d:%f"
,
&
p
->
max
,
&
p
->
hi
,
&
p
->
lo
,
&
p
->
frac
);
diff
=
diff_C
;
#if HAVE_MMX && HAVE_EBX_AVAILABLE
if
(
gCpuCaps
.
hasMMX
)
diff
=
diff_MMX
;
#endif
return
1
;
}
const
vf_info_t
vf_info_decimate
=
{
"near-duplicate frame remover"
,
"decimate"
,
"Rich Felker"
,
""
,
vf_open
,
NULL
};
libavfilter/sink_buffer.c
View file @
e3096771
...
...
@@ -143,7 +143,10 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
int
ret
;
*
bufref
=
NULL
;
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"abuffersink"
));
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"abuffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"ffbuffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"ffabuffersink"
));
/* no picref available, fetch it from the filterchain */
if
(
!
av_fifo_size
(
buf
->
fifo
))
{
...
...
@@ -166,7 +169,8 @@ int av_buffersink_get_buffer_ref(AVFilterContext *ctx,
AVRational
av_buffersink_get_frame_rate
(
AVFilterContext
*
ctx
)
{
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
));
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"ffbuffersink"
));
return
ctx
->
inputs
[
0
]
->
frame_rate
;
}
...
...
@@ -176,7 +180,10 @@ int av_buffersink_poll_frame(AVFilterContext *ctx)
BufferSinkContext
*
buf
=
ctx
->
priv
;
AVFilterLink
*
inlink
=
ctx
->
inputs
[
0
];
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"abuffersink"
));
av_assert0
(
!
strcmp
(
ctx
->
filter
->
name
,
"buffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"abuffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"ffbuffersink"
)
||
!
strcmp
(
ctx
->
filter
->
name
,
"ffabuffersink"
));
return
av_fifo_size
(
buf
->
fifo
)
/
sizeof
(
AVFilterBufferRef
*
)
+
ff_poll_frame
(
inlink
);
}
...
...
@@ -218,6 +225,23 @@ static int vsink_query_formats(AVFilterContext *ctx)
return
0
;
}
AVFilter
avfilter_vsink_ffbuffersink
=
{
.
name
=
"ffbuffersink"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer video frames, and make them available to the end of the filter graph."
),
.
priv_size
=
sizeof
(
BufferSinkContext
),
.
init_opaque
=
vsink_init
,
.
uninit
=
vsink_uninit
,
.
query_formats
=
vsink_query_formats
,
.
inputs
=
(
const
AVFilterPad
[])
{{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_VIDEO
,
.
end_frame
=
end_frame
,
.
min_perms
=
AV_PERM_READ
|
AV_PERM_PRESERVE
,
},
{
.
name
=
NULL
}},
.
outputs
=
(
const
AVFilterPad
[])
{{
.
name
=
NULL
}},
};
AVFilter
avfilter_vsink_buffersink
=
{
.
name
=
"buffersink"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer video frames, and make them available to the end of the filter graph."
),
...
...
@@ -299,6 +323,22 @@ static int asink_query_formats(AVFilterContext *ctx)
return
0
;
}
AVFilter
avfilter_asink_ffabuffersink
=
{
.
name
=
"ffabuffersink"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer audio frames, and make them available to the end of the filter graph."
),
.
init_opaque
=
asink_init
,
.
uninit
=
asink_uninit
,
.
priv_size
=
sizeof
(
BufferSinkContext
),
.
query_formats
=
asink_query_formats
,
.
inputs
=
(
const
AVFilterPad
[])
{{
.
name
=
"default"
,
.
type
=
AVMEDIA_TYPE_AUDIO
,
.
filter_samples
=
filter_samples
,
.
min_perms
=
AV_PERM_READ
|
AV_PERM_PRESERVE
,
},
{
.
name
=
NULL
}},
.
outputs
=
(
const
AVFilterPad
[])
{{
.
name
=
NULL
}},
};
AVFilter
avfilter_asink_abuffersink
=
{
.
name
=
"abuffersink"
,
.
description
=
NULL_IF_CONFIG_SMALL
(
"Buffer audio frames, and make them available to the end of the filter graph."
),
...
...
libavfilter/version.h
View file @
e3096771
...
...
@@ -30,7 +30,7 @@
#define LIBAVFILTER_VERSION_MAJOR 3
#define LIBAVFILTER_VERSION_MINOR 15
#define LIBAVFILTER_VERSION_MICRO 10
1
#define LIBAVFILTER_VERSION_MICRO 10
2
#define LIBAVFILTER_VERSION_INT AV_VERSION_INT(LIBAVFILTER_VERSION_MAJOR, \
LIBAVFILTER_VERSION_MINOR, \
...
...
libavfilter/vf_mp.c
View file @
e3096771
...
...
@@ -127,7 +127,6 @@ extern const vf_info_t vf_info_1bpp;
extern
const
vf_info_t
vf_info_ass
;
extern
const
vf_info_t
vf_info_bmovl
;
extern
const
vf_info_t
vf_info_crop
;
extern
const
vf_info_t
vf_info_decimate
;
extern
const
vf_info_t
vf_info_denoise3d
;
extern
const
vf_info_t
vf_info_detc
;
extern
const
vf_info_t
vf_info_dint
;
...
...
@@ -189,7 +188,6 @@ extern const vf_info_t vf_info_zrmjpeg;
static
const
vf_info_t
*
const
filters
[]
=
{
&
vf_info_decimate
,
&
vf_info_denoise3d
,
&
vf_info_detc
,
&
vf_info_dint
,
...
...
libavformat/filmstripdec.c
View file @
e3096771
...
...
@@ -45,7 +45,7 @@ static int read_header(AVFormatContext *s)
avio_seek
(
pb
,
avio_size
(
pb
)
-
36
,
SEEK_SET
);
if
(
avio_rb32
(
pb
)
!=
RAND_TAG
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"magic number not found"
);
av_log
(
s
,
AV_LOG_ERROR
,
"magic number not found
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/flic.c
View file @
e3096771
...
...
@@ -187,7 +187,7 @@ static int flic_read_header(AVFormatContext *s)
(
magic_number
==
FLIC_FILE_MAGIC_3
))
{
avpriv_set_pts_info
(
st
,
64
,
speed
,
1000
);
}
else
{
av_log
(
s
,
AV_LOG_
INFO
,
"Invalid or unsupported magic chunk in file
\n
"
);
av_log
(
s
,
AV_LOG_
ERROR
,
"Invalid or unsupported magic chunk in file
\n
"
);
return
AVERROR_INVALIDDATA
;
}
...
...
libavformat/matroskadec.c
View file @
e3096771
...
...
@@ -2105,10 +2105,29 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
else
pkt
->
pts
=
timecode
;
pkt
->
pos
=
pos
;
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_SUBRIP
)
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_SUBRIP
)
{
/*
* For backward compatibility.
* Historically, we have put subtitle duration
* in convergence_duration, on the off chance
* that the time_scale is less than 1us, which
* could result in a 32bit overflow on the
* normal duration field.
*/
pkt
->
convergence_duration
=
lace_duration
;
else
if
(
track
->
type
!=
MATROSKA_TRACK_TYPE_SUBTITLE
)
}
if
(
track
->
type
!=
MATROSKA_TRACK_TYPE_SUBTITLE
||
lace_duration
<=
INT_MAX
)
{
/*
* For non subtitle tracks, just store the duration
* as normal.
*
* If it's a subtitle track and duration value does
* not overflow a uint32, then also store it normally.
*/
pkt
->
duration
=
lace_duration
;
}
if
(
st
->
codec
->
codec_id
==
AV_CODEC_ID_SSA
)
matroska_fix_ass_packet
(
matroska
,
pkt
,
lace_duration
);
...
...
libavformat/matroskaenc.c
View file @
e3096771
...
...
@@ -1168,7 +1168,10 @@ static int mkv_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
duration
=
mkv_write_srt_blocks
(
s
,
pb
,
pkt
);
}
else
{
ebml_master
blockgroup
=
start_ebml_master
(
pb
,
MATROSKA_ID_BLOCKGROUP
,
mkv_blockgroup_size
(
pkt
->
size
));
duration
=
pkt
->
convergence_duration
;
/* For backward compatibility, prefer convergence_duration. */
if
(
pkt
->
convergence_duration
>
0
)
{
duration
=
pkt
->
convergence_duration
;
}
mkv_write_block
(
s
,
pb
,
MATROSKA_ID_BLOCK
,
pkt
,
0
);
put_ebml_uint
(
pb
,
MATROSKA_ID_BLOCKDURATION
,
duration
);
end_ebml_master
(
pb
,
blockgroup
);
...
...
libavformat/srtenc.c
View file @
e3096771
...
...
@@ -65,6 +65,7 @@ static int srt_write_packet(AVFormatContext *avf, AVPacket *pkt)
int
len
;
if
(
d
<=
0
)
/* For backward compatibility, fallback to convergence_duration. */
d
=
pkt
->
convergence_duration
;
if
(
s
==
AV_NOPTS_VALUE
||
d
<=
0
)
{
av_log
(
avf
,
AV_LOG_ERROR
,
"Insufficient timestamps.
\n
"
);
...
...
libavformat/wtvdec.c
View file @
e3096771
...
...
@@ -695,7 +695,7 @@ static AVStream * parse_media_type(AVFormatContext *s, AVStream *st, int sid,
if
(
ff_guidcmp
(
formattype
,
ff_format_none
))
av_log
(
s
,
AV_LOG_WARNING
,
"unknown formattype:"
FF_PRI_GUID
"
\n
"
,
FF_ARG_GUID
(
formattype
));
avio_skip
(
pb
,
size
);
st
->
codec
->
codec_id
=
AV_CODEC_ID_DVB_TELETEXT
;
st
->
codec
->
codec_id
=
!
ff_guidcmp
(
subtype
,
mediasubtype_teletext
)
?
AV_CODEC_ID_DVB_TELETEXT
:
AV_CODEC_ID_EIA_608
;
return
st
;
}
else
if
(
!
ff_guidcmp
(
mediatype
,
mediatype_mpeg2_sections
)
&&
!
ff_guidcmp
(
subtype
,
mediasubtype_mpeg2_sections
))
{
...
...
libswresample/resample.c
View file @
e3096771
...
...
@@ -401,7 +401,7 @@ int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensatio
#undef FELEM_MAX
#undef FILTER_SHIFT
#if HAVE_SSSE3
#if HAVE_SSSE3
_INLINE
#define COMMON_CORE COMMON_CORE_INT16_SSSE3
#define RENAME(N) N ## _int16_ssse3
#define FILTER_SHIFT 15
...
...
@@ -424,7 +424,7 @@ int swri_multiple_resample(ResampleContext *c, AudioData *dst, int dst_size, Aud
for
(
i
=
0
;
i
<
dst
->
ch_count
;
i
++
){
#if ARCH_X86
#if HAVE_SSSE3
#if HAVE_SSSE3
_INLINE
if
(
c
->
format
==
AV_SAMPLE_FMT_S16P
&&
(
mm_flags
&
AV_CPU_FLAG_SSSE3
))
ret
=
swri_resample_int16_ssse3
(
c
,
(
int16_t
*
)
dst
->
ch
[
i
],
(
const
int16_t
*
)
src
->
ch
[
i
],
consumed
,
src_size
,
dst_size
,
i
+
1
==
dst
->
ch_count
);
else
#endif
...
...
tests/fate/utvideo.mak
View file @
e3096771
...
...
@@ -28,7 +28,7 @@ fate-utvideo_yuv422_median: CMD = framecrc -i $(SAMPLES)/utvideo/utvideo_yuv422_
FATE_SAMPLES_AVCONV += $(FATE_UTVIDEO)
fate-utvideo: $(FATE_UTVIDEO)
fate-utvideoenc%: CMD = framemd5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -vcodec utvideo -
f avi -
sws_flags +accurate_rnd+bitexact ${OPTS}
fate-utvideoenc%: CMD = framemd5 -f image2 -vcodec pgmyuv -i $(TARGET_PATH)/tests/vsynth1/%02d.pgm -vcodec utvideo -sws_flags +accurate_rnd+bitexact ${OPTS}
FATE_UTVIDEOENC += fate-utvideoenc_rgba_none
fate-utvideoenc_rgba_none: OPTS = -pix_fmt rgba -pred 3
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment