Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
930d035e72 | ||
![]() |
875649bfae | ||
![]() |
70127070dd | ||
![]() |
d83ab33715 | ||
![]() |
06190d75d0 | ||
![]() |
c9ea1f7fc5 | ||
![]() |
47de8ccf42 | ||
![]() |
72c1de649a | ||
![]() |
5e3e67f977 | ||
![]() |
221bbd002c | ||
![]() |
fffc9316da | ||
![]() |
9a87ba0933 | ||
![]() |
d8538a1002 | ||
![]() |
6cb33e0763 | ||
![]() |
2e75c45593 | ||
![]() |
ba4cb43f0b | ||
![]() |
dc73774792 | ||
![]() |
ce11d9490c | ||
![]() |
430ef8a716 | ||
![]() |
627772d988 | ||
![]() |
5ce57e0248 | ||
![]() |
5effd65312 | ||
![]() |
cb340ecd7d | ||
![]() |
b88bea1d6c | ||
![]() |
99036565ca | ||
![]() |
fcc6460dbf | ||
![]() |
1065d4197e | ||
![]() |
fbb1af39e4 | ||
![]() |
073bde2b1f | ||
![]() |
e4bb67bc50 | ||
![]() |
59549b5ab7 | ||
![]() |
c0445df5b3 | ||
![]() |
c77b3737b9 | ||
![]() |
04d6946600 | ||
![]() |
ae93d3405e | ||
![]() |
054779625f | ||
![]() |
e22dd7fbd0 | ||
![]() |
376a9f8e6e | ||
![]() |
9af68f8d1f | ||
![]() |
f2361593ca | ||
![]() |
96e6d4da37 | ||
![]() |
735deda2cf | ||
![]() |
5f64a7a625 | ||
![]() |
ffd28de388 | ||
![]() |
af589dd5e9 | ||
![]() |
fd60aeb55b | ||
![]() |
79a3f364dd | ||
![]() |
33d699a4e7 |
26
configure
vendored
26
configure
vendored
@@ -140,10 +140,10 @@ Component options:
|
||||
--disable-fft disable FFT code
|
||||
|
||||
Hardware accelerators:
|
||||
--enable-dxva2 enable DXVA2 code
|
||||
--enable-vaapi enable VAAPI code
|
||||
--disable-dxva2 disable DXVA2 code [autodetect]
|
||||
--disable-vaapi disable VAAPI code [autodetect]
|
||||
--enable-vda enable VDA code
|
||||
--enable-vdpau enable VDPAU code
|
||||
--disable-vdpau disable VDPAU code [autodetect]
|
||||
|
||||
Individual component options:
|
||||
--disable-everything disable all components listed below
|
||||
@@ -184,11 +184,11 @@ Individual component options:
|
||||
|
||||
External library support:
|
||||
--enable-avisynth enable reading of AVISynth script files [no]
|
||||
--enable-bzlib enable bzlib [autodetect]
|
||||
--disable-bzlib disable bzlib [autodetect]
|
||||
--enable-fontconfig enable fontconfig
|
||||
--enable-frei0r enable frei0r video filtering
|
||||
--enable-gnutls enable gnutls [no]
|
||||
--enable-iconv enable iconv [autodetect]
|
||||
--disable-iconv disable iconv [autodetect]
|
||||
--enable-libaacplus enable AAC+ encoding via libaacplus [no]
|
||||
--enable-libass enable libass subtitles rendering [no]
|
||||
--enable-libbluray enable BluRay reading using libbluray [no]
|
||||
@@ -235,7 +235,7 @@ External library support:
|
||||
--enable-openal enable OpenAL 1.1 capture support [no]
|
||||
--enable-openssl enable openssl [no]
|
||||
--enable-x11grab enable X11 grabbing [no]
|
||||
--enable-zlib enable zlib [autodetect]
|
||||
--disable-zlib disable zlib [autodetect]
|
||||
|
||||
Advanced options (experts only):
|
||||
--cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
|
||||
@@ -2169,8 +2169,8 @@ enable safe_bitstream_reader
|
||||
enable static
|
||||
enable swscale_alpha
|
||||
|
||||
# By default, enable only those hwaccels that have no external dependencies.
|
||||
enable dxva2 vdpau
|
||||
# Enable hwaccels by default.
|
||||
enable dxva2 vaapi vdpau
|
||||
|
||||
# build settings
|
||||
SHFLAGS='-shared -Wl,-soname,$$(@F)'
|
||||
@@ -3876,7 +3876,6 @@ fi
|
||||
|
||||
check_lib math.h sin -lm && LIBM="-lm"
|
||||
disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
|
||||
enabled vaapi && require vaapi va/va.h vaInitialize -lva
|
||||
|
||||
atan2f_args=2
|
||||
ldexpf_args=2
|
||||
@@ -4044,12 +4043,9 @@ require X11 X11/Xlib.h XOpenDisplay -lX11 &&
|
||||
require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
|
||||
require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
|
||||
|
||||
if ! disabled vaapi; then
|
||||
check_lib va/va.h vaInitialize -lva && {
|
||||
check_cpp_condition va/va_version.h "VA_CHECK_VERSION(0,32,0)" ||
|
||||
warn "Please upgrade to VA-API >= 0.32 if you would like full VA-API support.";
|
||||
} || disable vaapi
|
||||
fi
|
||||
enabled vaapi &&
|
||||
check_lib va/va.h vaInitialize -lva ||
|
||||
disable vaapi
|
||||
|
||||
enabled vdpau &&
|
||||
check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
|
||||
|
@@ -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 = 1.2.1
|
||||
PROJECT_NUMBER = 1.2.2
|
||||
|
||||
# With the PROJECT_LOGO tag one can specify an logo or icon that is included
|
||||
# in the documentation. The maximum height of the logo should not exceed 55
|
||||
|
@@ -24,7 +24,7 @@ a mail for every change to every issue.
|
||||
The subscription URL for the ffmpeg-trac list is:
|
||||
http(s)://ffmpeg.org/mailman/listinfo/ffmpeg-trac
|
||||
The URL of the webinterface of the tracker is:
|
||||
http(s)://ffmpeg.org/trac/ffmpeg
|
||||
http(s)://trac.ffmpeg.org
|
||||
|
||||
Type:
|
||||
-----
|
||||
|
5
ffmpeg.c
5
ffmpeg.c
@@ -162,6 +162,8 @@ static struct termios oldtty;
|
||||
static int restore_tty;
|
||||
#endif
|
||||
|
||||
static void free_input_threads(void);
|
||||
|
||||
|
||||
/* sub2video hack:
|
||||
Convert subtitles to video with alpha to insert them in filter graphs.
|
||||
@@ -457,6 +459,9 @@ static void exit_program(void)
|
||||
av_freep(&output_streams[i]->logfile_prefix);
|
||||
av_freep(&output_streams[i]);
|
||||
}
|
||||
#if HAVE_PTHREADS
|
||||
free_input_threads();
|
||||
#endif
|
||||
for (i = 0; i < nb_input_files; i++) {
|
||||
avformat_close_input(&input_files[i]->ctx);
|
||||
av_freep(&input_files[i]);
|
||||
|
@@ -710,7 +710,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
|
||||
const float lambda)
|
||||
{
|
||||
int start = 0, i, w, w2, g;
|
||||
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
|
||||
int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * (lambda / 120.f);
|
||||
float dists[128] = { 0 }, uplims[128];
|
||||
float maxvals[128];
|
||||
int fflag, minscaler;
|
||||
|
@@ -274,7 +274,7 @@ static void alac_linear_predictor(AlacEncodeContext *s, int ch)
|
||||
// generate warm-up samples
|
||||
residual[0] = samples[0];
|
||||
for (i = 1; i <= lpc.lpc_order; i++)
|
||||
residual[i] = samples[i] - samples[i-1];
|
||||
residual[i] = sign_extend(samples[i] - samples[i-1], s->write_sample_size);
|
||||
|
||||
// perform lpc on remaining samples
|
||||
for (i = lpc.lpc_order + 1; i < s->frame_size; i++) {
|
||||
|
@@ -661,8 +661,8 @@ static int decode_channel_sound_unit(ATRAC3Context *q, GetBitContext *gb,
|
||||
|
||||
snd->num_components = decode_tonal_components(gb, snd->components,
|
||||
snd->bands_coded);
|
||||
if (snd->num_components == -1)
|
||||
return -1;
|
||||
if (snd->num_components < 0)
|
||||
return snd->num_components;
|
||||
|
||||
num_subbands = decode_spectrum(gb, snd->spectrum);
|
||||
|
||||
|
@@ -706,7 +706,7 @@ int ff_h264_decode_mb_cavlc(H264Context *h){
|
||||
down the code */
|
||||
if(h->slice_type_nos != AV_PICTURE_TYPE_I){
|
||||
if(h->mb_skip_run==-1)
|
||||
h->mb_skip_run= get_ue_golomb(&h->gb);
|
||||
h->mb_skip_run= get_ue_golomb_long(&h->gb);
|
||||
|
||||
if (h->mb_skip_run--) {
|
||||
if(FRAME_MBAFF && (h->mb_y&1) == 0){
|
||||
|
@@ -31,9 +31,11 @@
|
||||
c->put_h264_chroma_pixels_tab[0] = put_h264_chroma_mc8_ ## depth ## _c; \
|
||||
c->put_h264_chroma_pixels_tab[1] = put_h264_chroma_mc4_ ## depth ## _c; \
|
||||
c->put_h264_chroma_pixels_tab[2] = put_h264_chroma_mc2_ ## depth ## _c; \
|
||||
c->put_h264_chroma_pixels_tab[3] = put_h264_chroma_mc1_ ## depth ## _c; \
|
||||
c->avg_h264_chroma_pixels_tab[0] = avg_h264_chroma_mc8_ ## depth ## _c; \
|
||||
c->avg_h264_chroma_pixels_tab[1] = avg_h264_chroma_mc4_ ## depth ## _c; \
|
||||
c->avg_h264_chroma_pixels_tab[2] = avg_h264_chroma_mc2_ ## depth ## _c; \
|
||||
c->avg_h264_chroma_pixels_tab[3] = avg_h264_chroma_mc1_ ## depth ## _c; \
|
||||
|
||||
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth)
|
||||
{
|
||||
|
@@ -24,8 +24,8 @@
|
||||
typedef void (*h264_chroma_mc_func)(uint8_t *dst/*align 8*/, uint8_t *src/*align 1*/, int srcStride, int h, int x, int y);
|
||||
|
||||
typedef struct H264ChromaContext {
|
||||
h264_chroma_mc_func put_h264_chroma_pixels_tab[3];
|
||||
h264_chroma_mc_func avg_h264_chroma_pixels_tab[3];
|
||||
h264_chroma_mc_func put_h264_chroma_pixels_tab[4];
|
||||
h264_chroma_mc_func avg_h264_chroma_pixels_tab[4];
|
||||
} H264ChromaContext;
|
||||
|
||||
void ff_h264chroma_init(H264ChromaContext *c, int bit_depth);
|
||||
|
@@ -24,6 +24,34 @@
|
||||
#include "bit_depth_template.c"
|
||||
|
||||
#define H264_CHROMA_MC(OPNAME, OP)\
|
||||
static void FUNCC(OPNAME ## h264_chroma_mc1)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
|
||||
pixel *dst = (pixel*)_dst;\
|
||||
pixel *src = (pixel*)_src;\
|
||||
const int A=(8-x)*(8-y);\
|
||||
const int B=( x)*(8-y);\
|
||||
const int C=(8-x)*( y);\
|
||||
const int D=( x)*( y);\
|
||||
int i;\
|
||||
stride >>= sizeof(pixel)-1;\
|
||||
\
|
||||
av_assert2(x<8 && y<8 && x>=0 && y>=0);\
|
||||
\
|
||||
if(D){\
|
||||
for(i=0; i<h; i++){\
|
||||
OP(dst[0], (A*src[0] + B*src[1] + C*src[stride+0] + D*src[stride+1]));\
|
||||
dst+= stride;\
|
||||
src+= stride;\
|
||||
}\
|
||||
}else{\
|
||||
const int E= B+C;\
|
||||
const int step= C ? stride : 1;\
|
||||
for(i=0; i<h; i++){\
|
||||
OP(dst[0], (A*src[0] + E*src[step+0]));\
|
||||
dst+= stride;\
|
||||
src+= stride;\
|
||||
}\
|
||||
}\
|
||||
}\
|
||||
static void FUNCC(OPNAME ## h264_chroma_mc2)(uint8_t *_dst/*align 8*/, uint8_t *_src/*align 1*/, int stride, int h, int x, int y){\
|
||||
pixel *dst = (pixel*)_dst;\
|
||||
pixel *src = (pixel*)_src;\
|
||||
|
@@ -804,8 +804,16 @@ static int decode_band(IVI45DecContext *ctx,
|
||||
break;
|
||||
|
||||
result = ivi_decode_blocks(&ctx->gb, band, tile, avctx);
|
||||
if (result < 0 || ((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "Corrupted tile data encountered!\n");
|
||||
if (result < 0) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Corrupted tile data encountered!\n");
|
||||
break;
|
||||
}
|
||||
|
||||
if (((get_bits_count(&ctx->gb) - pos) >> 3) != tile->data_size) {
|
||||
av_log(avctx, AV_LOG_ERROR,
|
||||
"Tile data_size mismatch!\n");
|
||||
result = AVERROR_INVALIDDATA;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@@ -1266,7 +1266,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx)
|
||||
s1->save_width != s->width ||
|
||||
s1->save_height != s->height ||
|
||||
s1->save_aspect_info != s->aspect_ratio_info ||
|
||||
s1->save_progressive_seq != s->progressive_sequence ||
|
||||
(s1->save_progressive_seq != s->progressive_sequence && (s->height&31)) ||
|
||||
0)
|
||||
{
|
||||
|
||||
@@ -2277,7 +2277,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
||||
buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code);
|
||||
if (start_code > 0x1ff) {
|
||||
if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) {
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||
!avctx->hwaccel) {
|
||||
int i;
|
||||
av_assert0(avctx->thread_count > 1);
|
||||
|
||||
@@ -2337,7 +2338,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
||||
s2->intra_dc_precision= 3;
|
||||
s2->intra_matrix[0]= 1;
|
||||
}
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) && s->slice_count) {
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||
!avctx->hwaccel && s->slice_count) {
|
||||
int i;
|
||||
|
||||
avctx->execute(avctx, slice_decode_thread,
|
||||
@@ -2504,7 +2506,8 @@ static int decode_chunks(AVCodecContext *avctx,
|
||||
break;
|
||||
}
|
||||
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) {
|
||||
if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE) &&
|
||||
!avctx->hwaccel) {
|
||||
int threshold = (s2->mb_height * s->slice_count +
|
||||
s2->slice_context_count / 2) /
|
||||
s2->slice_context_count;
|
||||
|
@@ -2102,7 +2102,7 @@ static inline int hpel_motion_lowres(MpegEncContext *s,
|
||||
int motion_x, int motion_y)
|
||||
{
|
||||
const int lowres = s->avctx->lowres;
|
||||
const int op_index = FFMIN(lowres, 2);
|
||||
const int op_index = FFMIN(lowres, 3);
|
||||
const int s_mask = (2 << lowres) - 1;
|
||||
int emu = 0;
|
||||
int sx, sy;
|
||||
@@ -2155,7 +2155,7 @@ static av_always_inline void mpeg_motion_lowres(MpegEncContext *s,
|
||||
int mx, my, src_x, src_y, uvsrc_x, uvsrc_y, uvlinesize, linesize, sx, sy,
|
||||
uvsx, uvsy;
|
||||
const int lowres = s->avctx->lowres;
|
||||
const int op_index = FFMIN(lowres-1+s->chroma_x_shift, 2);
|
||||
const int op_index = FFMIN(lowres-1+s->chroma_x_shift, 3);
|
||||
const int block_s = 8>>lowres;
|
||||
const int s_mask = (2 << lowres) - 1;
|
||||
const int h_edge_pos = s->h_edge_pos >> lowres;
|
||||
@@ -2279,7 +2279,7 @@ static inline void chroma_4mv_motion_lowres(MpegEncContext *s,
|
||||
int mx, int my)
|
||||
{
|
||||
const int lowres = s->avctx->lowres;
|
||||
const int op_index = FFMIN(lowres, 2);
|
||||
const int op_index = FFMIN(lowres, 3);
|
||||
const int block_s = 8 >> lowres;
|
||||
const int s_mask = (2 << lowres) - 1;
|
||||
const int h_edge_pos = s->h_edge_pos >> lowres + 1;
|
||||
|
@@ -767,7 +767,8 @@ static int synthfilt_build_sb_samples (QDM2Context *q, GetBitContext *gb, int le
|
||||
int type34_first;
|
||||
float type34_div = 0;
|
||||
float type34_predictor;
|
||||
float samples[10], sign_bits[16];
|
||||
float samples[10];
|
||||
int sign_bits[16] = {0};
|
||||
|
||||
if (length == 0) {
|
||||
// If no data use noise
|
||||
|
@@ -67,7 +67,7 @@ static void qtrle_decode_1bpp(QtrleContext *s, int row_ptr, int lines_to_change)
|
||||
* line' at the beginning. Since we always interpret it as 'go to next line'
|
||||
* in the decoding loop (which makes code simpler/faster), the first line
|
||||
* would not be counted, so we count one more.
|
||||
* See: https://ffmpeg.org/trac/ffmpeg/ticket/226
|
||||
* See: https://trac.ffmpeg.org/ticket/226
|
||||
* In the following decoding loop, row_ptr will be the position of the
|
||||
* current row. */
|
||||
|
||||
|
@@ -694,7 +694,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
val |= h[3].values[res] << 8;
|
||||
pred[1] += sign_extend(val, 16);
|
||||
*samples++ = av_clip_int16(pred[1]);
|
||||
*samples++ = pred[1];
|
||||
} else {
|
||||
if(vlc[0].table)
|
||||
res = get_vlc2(&gb, vlc[0].table, SMKTREE_BITS, 3);
|
||||
@@ -715,7 +715,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
|
||||
}
|
||||
val |= h[1].values[res] << 8;
|
||||
pred[0] += sign_extend(val, 16);
|
||||
*samples++ = av_clip_int16(pred[0]);
|
||||
*samples++ = pred[0];
|
||||
}
|
||||
}
|
||||
} else { //8-bit data
|
||||
|
@@ -474,7 +474,7 @@ static int video_get_buffer(AVCodecContext *s, AVFrame *pic)
|
||||
|
||||
buf->linesize[i] = picture.linesize[i];
|
||||
|
||||
buf->base[i] = av_malloc(size[i] + 16); //FIXME 16
|
||||
buf->base[i] = av_malloc(size[i] + 16 + STRIDE_ALIGN - 1); //FIXME 16
|
||||
if (buf->base[i] == NULL)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
|
@@ -46,6 +46,9 @@ int ff_vaapi_render_picture(struct vaapi_context *vactx, VASurfaceID surface)
|
||||
VABufferID va_buffers[3];
|
||||
unsigned int n_va_buffers = 0;
|
||||
|
||||
if (!vactx->pic_param_buf_id)
|
||||
return 0;
|
||||
|
||||
vaUnmapBuffer(vactx->display, vactx->pic_param_buf_id);
|
||||
va_buffers[n_va_buffers++] = vactx->pic_param_buf_id;
|
||||
|
||||
|
@@ -1764,7 +1764,7 @@ static av_cold void dsputil_init_sse2(DSPContext *c, AVCodecContext *avctx,
|
||||
const int high_bit_depth = bit_depth > 8;
|
||||
|
||||
#if HAVE_SSE2_INLINE
|
||||
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX) {
|
||||
if (!high_bit_depth && avctx->idct_algo == FF_IDCT_XVIDMMX && avctx->lowres == 0) {
|
||||
c->idct_put = ff_idct_xvid_sse2_put;
|
||||
c->idct_add = ff_idct_xvid_sse2_add;
|
||||
c->idct = ff_idct_xvid_sse2;
|
||||
|
@@ -74,7 +74,7 @@ static av_always_inline av_const int64_t MUL64(int a, int b)
|
||||
static inline av_const int mid_pred(int a, int b, int c)
|
||||
{
|
||||
int i=b;
|
||||
__asm__ volatile(
|
||||
__asm__ (
|
||||
"cmp %2, %1 \n\t"
|
||||
"cmovg %1, %0 \n\t"
|
||||
"cmovg %2, %1 \n\t"
|
||||
|
@@ -26,7 +26,7 @@
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
#include "dsputil_mmx.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if HAVE_MMX_INLINE
|
||||
|
||||
static void dct_unquantize_h263_intra_mmx(MpegEncContext *s,
|
||||
int16_t *block, int n, int qscale)
|
||||
@@ -574,11 +574,11 @@ static void denoise_dct_sse2(MpegEncContext *s, int16_t *block){
|
||||
);
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
|
||||
av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
||||
{
|
||||
#if HAVE_INLINE_ASM
|
||||
#if HAVE_MMX_INLINE
|
||||
int mm_flags = av_get_cpu_flags();
|
||||
|
||||
if (mm_flags & AV_CPU_FLAG_MMX) {
|
||||
@@ -596,5 +596,5 @@ av_cold void ff_MPV_common_init_x86(MpegEncContext *s)
|
||||
s->denoise_dct= denoise_dct_mmx;
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
}
|
||||
|
@@ -43,7 +43,7 @@ void ff_vp3_v_loop_filter_mmxext(uint8_t *src, int stride,
|
||||
void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride,
|
||||
int *bounding_values);
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if HAVE_MMX_INLINE
|
||||
|
||||
#define MOVQ_BFE(regd) \
|
||||
__asm__ volatile ( \
|
||||
@@ -95,15 +95,15 @@ static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const u
|
||||
:"memory");
|
||||
// STOP_TIMER("put_vp_no_rnd_pixels8_l2_mmx")
|
||||
}
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
|
||||
av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags)
|
||||
{
|
||||
int cpuflags = av_get_cpu_flags();
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
#if HAVE_MMX_INLINE
|
||||
c->put_no_rnd_pixels_l2 = put_vp_no_rnd_pixels8_l2_mmx;
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
#endif /* HAVE_MMX_INLINE */
|
||||
|
||||
#if ARCH_X86_32
|
||||
if (EXTERNAL_MMX(cpuflags)) {
|
||||
|
@@ -78,6 +78,7 @@ struct x11grab {
|
||||
int show_region; /**< set by a private option. */
|
||||
char *framerate; /**< Set by a private option. */
|
||||
|
||||
Cursor c;
|
||||
Window region_win; /**< This is used by show_region option. */
|
||||
};
|
||||
|
||||
@@ -353,7 +354,6 @@ paint_mouse_pointer(XImage *image, struct x11grab *s)
|
||||
* Anyone who performs further investigation of the xlib API likely risks
|
||||
* permanent brain damage. */
|
||||
uint8_t *pix = image->data;
|
||||
Cursor c;
|
||||
Window w;
|
||||
XSetWindowAttributes attr;
|
||||
|
||||
@@ -361,9 +361,10 @@ paint_mouse_pointer(XImage *image, struct x11grab *s)
|
||||
if (image->bits_per_pixel != 24 && image->bits_per_pixel != 32)
|
||||
return;
|
||||
|
||||
c = XCreateFontCursor(dpy, XC_left_ptr);
|
||||
if(!s->c)
|
||||
s->c = XCreateFontCursor(dpy, XC_left_ptr);
|
||||
w = DefaultRootWindow(dpy);
|
||||
attr.cursor = c;
|
||||
attr.cursor = s->c;
|
||||
XChangeWindowAttributes(dpy, w, CWCursor, &attr);
|
||||
|
||||
xcim = XFixesGetCursorImage(dpy);
|
||||
|
@@ -117,6 +117,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
||||
ff_get_audio_buffer(inlink, AV_PERM_WRITE,
|
||||
insamples->audio->nb_samples);
|
||||
int ret;
|
||||
int len;
|
||||
|
||||
if (!outsamples)
|
||||
return AVERROR(ENOMEM);
|
||||
@@ -126,16 +127,20 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamples)
|
||||
out = (int16_t *)outsamples->data[0];
|
||||
in = (int16_t *)insamples ->data[0];
|
||||
|
||||
len = FFMIN(NUMTAPS, 2*insamples->audio->nb_samples);
|
||||
// copy part of new input and process with saved input
|
||||
memcpy(taps+NUMTAPS, in, NUMTAPS * sizeof(*taps));
|
||||
out = scalarproduct(taps, taps + NUMTAPS, out);
|
||||
memcpy(taps+NUMTAPS, in, len * sizeof(*taps));
|
||||
out = scalarproduct(taps, taps + len, out);
|
||||
|
||||
// process current input
|
||||
if (2*insamples->audio->nb_samples >= NUMTAPS ){
|
||||
endin = in + insamples->audio->nb_samples * 2 - NUMTAPS;
|
||||
scalarproduct(in, endin, out);
|
||||
|
||||
// save part of input for next round
|
||||
memcpy(taps, endin, NUMTAPS * sizeof(*taps));
|
||||
} else
|
||||
memmove(taps, taps + 2*insamples->audio->nb_samples, NUMTAPS * sizeof(*taps));
|
||||
|
||||
ret = ff_filter_frame(outlink, outsamples);
|
||||
avfilter_unref_buffer(insamples);
|
||||
|
@@ -706,7 +706,9 @@ static int avi_read_header(AVFormatContext *s)
|
||||
}
|
||||
break;
|
||||
case MKTAG('s', 't', 'r', 'd'):
|
||||
if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
|
||||
if (stream_index >= (unsigned)s->nb_streams
|
||||
|| s->streams[stream_index]->codec->extradata_size
|
||||
|| s->streams[stream_index]->codec->codec_tag == MKTAG('H','2','6','4')) {
|
||||
avio_skip(pb, size);
|
||||
} else {
|
||||
uint64_t cur_pos = avio_tell(pb);
|
||||
@@ -1003,10 +1005,10 @@ start_sync:
|
||||
|| st->discard >= AVDISCARD_ALL){
|
||||
if (!exit_early) {
|
||||
ast->frame_offset += get_duration(ast, size);
|
||||
}
|
||||
avio_skip(pb, size);
|
||||
goto start_sync;
|
||||
}
|
||||
}
|
||||
|
||||
if (d[2] == 'p' && d[3] == 'c' && size<=4*256+4) {
|
||||
int k = avio_r8(pb);
|
||||
|
@@ -523,7 +523,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
int size= pkt->size;
|
||||
|
||||
av_dlog(s, "dts:%s packet_count:%d stream_index:%d\n", av_ts2str(pkt->dts), avist->packet_count, stream_index);
|
||||
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB){
|
||||
while(enc->block_align==0 && pkt->dts != AV_NOPTS_VALUE && pkt->dts > avist->packet_count && enc->codec_id != AV_CODEC_ID_XSUB && avist->packet_count){
|
||||
AVPacket empty_packet;
|
||||
|
||||
if(pkt->dts - avist->packet_count > 60000){
|
||||
|
@@ -34,6 +34,7 @@ static int dts_probe(AVProbeData *p)
|
||||
uint32_t state = -1;
|
||||
int markers[3] = {0};
|
||||
int sum, max;
|
||||
int64_t diff = 0;
|
||||
|
||||
buf = p->buf;
|
||||
|
||||
@@ -54,12 +55,16 @@ static int dts_probe(AVProbeData *p)
|
||||
if (state == DCA_MARKER_14B_LE)
|
||||
if ((bytestream_get_be16(&bufp) & 0xF0FF) == 0xF007)
|
||||
markers[2]++;
|
||||
|
||||
if (buf - p->buf >= 4)
|
||||
diff += FFABS(AV_RL16(buf) - AV_RL16(buf-4));
|
||||
}
|
||||
sum = markers[0] + markers[1] + markers[2];
|
||||
max = markers[1] > markers[0];
|
||||
max = markers[2] > markers[max] ? 2 : max;
|
||||
if (markers[max] > 3 && p->buf_size / markers[max] < 32*1024 &&
|
||||
markers[max] * 4 > sum * 3)
|
||||
markers[max] * 4 > sum * 3 &&
|
||||
diff / p->buf_size > 200)
|
||||
return AVPROBE_SCORE_MAX/2+1;
|
||||
|
||||
return 0;
|
||||
|
@@ -93,7 +93,7 @@ typedef struct IdcinDemuxContext {
|
||||
|
||||
static int idcin_probe(AVProbeData *p)
|
||||
{
|
||||
unsigned int number;
|
||||
unsigned int number, sample_rate;
|
||||
|
||||
/*
|
||||
* This is what you could call a "probabilistic" file check: id CIN
|
||||
@@ -122,18 +122,18 @@ static int idcin_probe(AVProbeData *p)
|
||||
return 0;
|
||||
|
||||
/* check the audio sample rate */
|
||||
number = AV_RL32(&p->buf[8]);
|
||||
if ((number != 0) && ((number < 8000) | (number > 48000)))
|
||||
sample_rate = AV_RL32(&p->buf[8]);
|
||||
if (sample_rate && (sample_rate < 8000 || sample_rate > 48000))
|
||||
return 0;
|
||||
|
||||
/* check the audio bytes/sample */
|
||||
number = AV_RL32(&p->buf[12]);
|
||||
if (number > 2)
|
||||
if (number > 2 || sample_rate && !number)
|
||||
return 0;
|
||||
|
||||
/* check the audio channels */
|
||||
number = AV_RL32(&p->buf[16]);
|
||||
if (number > 2)
|
||||
if (number > 2 || sample_rate && !number)
|
||||
return 0;
|
||||
|
||||
/* return half certainly since this check is a bit sketchy */
|
||||
|
@@ -478,5 +478,5 @@ AVInputFormat ff_iff_demuxer = {
|
||||
.read_probe = iff_probe,
|
||||
.read_header = iff_read_header,
|
||||
.read_packet = iff_read_packet,
|
||||
.flags = AVFMT_GENERIC_INDEX,
|
||||
.flags = AVFMT_GENERIC_INDEX | AVFMT_NO_BYTE_SEEK,
|
||||
};
|
||||
|
@@ -347,6 +347,19 @@ static int modplug_read_seek(AVFormatContext *s, int stream_idx, int64_t ts, int
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const char modplug_extensions[] = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm,itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz";
|
||||
|
||||
static int modplug_probe(AVProbeData *p)
|
||||
{
|
||||
if (av_match_ext(p->filename, modplug_extensions)) {
|
||||
if (p->buf_size < 16384)
|
||||
return AVPROBE_SCORE_MAX/4-1;
|
||||
else
|
||||
return AVPROBE_SCORE_MAX/2;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const AVClass modplug_class = {
|
||||
.class_name = "ModPlug demuxer",
|
||||
.item_name = av_default_item_name,
|
||||
@@ -358,11 +371,11 @@ AVInputFormat ff_libmodplug_demuxer = {
|
||||
.name = "libmodplug",
|
||||
.long_name = NULL_IF_CONFIG_SMALL("ModPlug demuxer"),
|
||||
.priv_data_size = sizeof(ModPlugContext),
|
||||
.read_probe = modplug_probe,
|
||||
.read_header = modplug_read_header,
|
||||
.read_packet = modplug_read_packet,
|
||||
.read_close = modplug_read_close,
|
||||
.read_seek = modplug_read_seek,
|
||||
.extensions = "669,abc,amf,ams,dbm,dmf,dsm,far,it,mdl,med,mid,mod,mt2,mtm,okt,psm,ptm,s3m,stm,ult,umx,xm"
|
||||
",itgz,itr,itz,mdgz,mdr,mdz,s3gz,s3r,s3z,xmgz,xmr,xmz", // compressed mods
|
||||
.extensions = modplug_extensions,
|
||||
.priv_class = &modplug_class,
|
||||
};
|
||||
|
@@ -2205,6 +2205,7 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
uint32_t *lace_size = NULL;
|
||||
int n, flags, laces = 0;
|
||||
uint64_t num;
|
||||
int trust_default_duration = 1;
|
||||
|
||||
if ((n = matroska_ebmlnum_uint(matroska, data, size, &num)) < 0) {
|
||||
av_log(matroska->ctx, AV_LOG_ERROR, "EBML block data error\n");
|
||||
@@ -2259,7 +2260,15 @@ static int matroska_parse_block(MatroskaDemuxContext *matroska, uint8_t *data,
|
||||
if (res)
|
||||
goto end;
|
||||
|
||||
if (!block_duration)
|
||||
if (track->audio.samplerate == 8000) {
|
||||
// If this is needed for more codecs, then add them here
|
||||
if (st->codec->codec_id == AV_CODEC_ID_AC3) {
|
||||
if(track->audio.samplerate != st->codec->sample_rate || !st->codec->frame_size)
|
||||
trust_default_duration = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!block_duration && trust_default_duration)
|
||||
block_duration = track->default_duration * laces / matroska->time_scale;
|
||||
|
||||
if (cluster_time != (uint64_t)-1 && (block_time >= 0 || cluster_time >= -block_time))
|
||||
|
@@ -309,14 +309,16 @@ static int mmsh_open_internal(URLContext *h, const char *uri, int flags, int tim
|
||||
return 0;
|
||||
fail:
|
||||
av_freep(&stream_selection);
|
||||
mmsh_close(h);
|
||||
av_dlog(NULL, "Connection failed with error %d\n", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int mmsh_open(URLContext *h, const char *uri, int flags)
|
||||
{
|
||||
return mmsh_open_internal(h, uri, flags, 0, 0);
|
||||
int ret = mmsh_open_internal(h, uri, flags, 0, 0);
|
||||
if (ret < 0)
|
||||
mmsh_close(h);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int handle_chunk_type(MMSHContext *mmsh)
|
||||
|
@@ -880,7 +880,7 @@ static int mov_read_mvhd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
c->duration = (version == 1) ? avio_rb64(pb) : avio_rb32(pb); /* duration */
|
||||
// set the AVCodecContext duration because the duration of individual tracks
|
||||
// may be inaccurate
|
||||
if (c->time_scale > 0)
|
||||
if (c->time_scale > 0 && !c->trex_data)
|
||||
c->fc->duration = av_rescale(c->duration, AV_TIME_BASE, c->time_scale);
|
||||
avio_rb32(pb); /* preferred scale */
|
||||
|
||||
|
@@ -37,9 +37,11 @@
|
||||
|
||||
typedef struct {
|
||||
int64_t filesize;
|
||||
int64_t header_filesize;
|
||||
int xing_toc;
|
||||
int start_pad;
|
||||
int end_pad;
|
||||
int is_cbr;
|
||||
} MP3Context;
|
||||
|
||||
/* mp3 read */
|
||||
@@ -185,6 +187,9 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
|
||||
if (size && frames && !is_cbr)
|
||||
st->codec->bit_rate = av_rescale(size, 8 * c.sample_rate, frames * (int64_t)spf);
|
||||
|
||||
mp3->is_cbr = is_cbr;
|
||||
mp3->header_filesize = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -274,21 +279,33 @@ static int mp3_seek(AVFormatContext *s, int stream_index, int64_t timestamp,
|
||||
int flags)
|
||||
{
|
||||
MP3Context *mp3 = s->priv_data;
|
||||
AVIndexEntry *ie;
|
||||
AVIndexEntry *ie, ie1;
|
||||
AVStream *st = s->streams[0];
|
||||
int64_t ret = av_index_search_timestamp(st, timestamp, flags);
|
||||
int i, j;
|
||||
|
||||
if (!mp3->xing_toc) {
|
||||
if (mp3->is_cbr && st->duration > 0 && mp3->header_filesize > s->data_offset) {
|
||||
int64_t filesize = avio_size(s->pb);
|
||||
int64_t duration;
|
||||
if (filesize <= s->data_offset)
|
||||
filesize = mp3->header_filesize;
|
||||
filesize -= s->data_offset;
|
||||
duration = av_rescale(st->duration, filesize, mp3->header_filesize - s->data_offset);
|
||||
ie = &ie1;
|
||||
timestamp = av_clip64(timestamp, 0, duration);
|
||||
ie->timestamp = timestamp;
|
||||
ie->pos = av_rescale(timestamp, filesize, duration) + s->data_offset;
|
||||
} else if (mp3->xing_toc) {
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ie = &st->index_entries[ret];
|
||||
} else {
|
||||
st->skip_samples = timestamp <= 0 ? mp3->start_pad + 528 + 1 : 0;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ie = &st->index_entries[ret];
|
||||
ret = avio_seek(s->pb, ie->pos, SEEK_SET);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
@@ -1622,11 +1622,17 @@ static void pat_cb(MpegTSFilter *filter, const uint8_t *section, int section_len
|
||||
if (sid == 0x0000) {
|
||||
/* NIT info */
|
||||
} else {
|
||||
MpegTSFilter *fil = ts->pids[pmt_pid];
|
||||
program = av_new_program(ts->stream, sid);
|
||||
program->program_num = sid;
|
||||
program->pmt_pid = pmt_pid;
|
||||
if (ts->pids[pmt_pid])
|
||||
if (fil)
|
||||
if ( fil->type != MPEGTS_SECTION
|
||||
|| fil->pid != pmt_pid
|
||||
|| fil->u.section_filter.section_cb != pmt_cb)
|
||||
mpegts_close_filter(ts, ts->pids[pmt_pid]);
|
||||
|
||||
if (!ts->pids[pmt_pid])
|
||||
mpegts_open_section_filter(ts, pmt_pid, pmt_cb, ts, 1);
|
||||
add_pat_entry(ts, sid);
|
||||
add_pid_to_pmt(ts, sid, 0); //add pat pid to program
|
||||
|
@@ -1600,8 +1600,10 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
|
||||
}
|
||||
if (descriptor->extradata) {
|
||||
st->codec->extradata = av_mallocz(descriptor->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (st->codec->extradata)
|
||||
if (st->codec->extradata) {
|
||||
memcpy(st->codec->extradata, descriptor->extradata, descriptor->extradata_size);
|
||||
st->codec->extradata_size = descriptor->extradata_size;
|
||||
}
|
||||
} else if(st->codec->codec_id == CODEC_ID_H264) {
|
||||
ff_generate_avci_extradata(st);
|
||||
}
|
||||
|
@@ -37,6 +37,9 @@ static int skeleton_header(AVFormatContext *s, int idx)
|
||||
strcpy(st->codec->codec_name, "skeleton");
|
||||
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
||||
|
||||
if ((os->flags & OGG_FLAG_EOS) && os->psize == 0)
|
||||
return 1;
|
||||
|
||||
if (os->psize < 8)
|
||||
return -1;
|
||||
|
||||
@@ -74,12 +77,16 @@ static int skeleton_header(AVFormatContext *s, int idx)
|
||||
|
||||
target_idx = ogg_find_stream(ogg, AV_RL32(buf+12));
|
||||
start_granule = AV_RL64(buf+36);
|
||||
if (os->start_granule != OGG_NOGRANULE_VALUE) {
|
||||
av_log_missing_feature(s,
|
||||
"Multiple fisbone for the same stream", 0);
|
||||
if (target_idx < 0) {
|
||||
av_log(s, AV_LOG_WARNING, "Serial number in fisbone doesn't match any stream\n");
|
||||
return 1;
|
||||
}
|
||||
if (target_idx >= 0 && start_granule != OGG_NOGRANULE_VALUE) {
|
||||
os = ogg->streams + target_idx;
|
||||
if (os->start_granule != OGG_NOGRANULE_VALUE) {
|
||||
av_log(s, AV_LOG_WARNING, "Multiple fisbone for the same stream\n");
|
||||
return 1;
|
||||
}
|
||||
if (start_granule != OGG_NOGRANULE_VALUE) {
|
||||
os->start_granule = start_granule;
|
||||
}
|
||||
}
|
||||
|
@@ -95,13 +95,14 @@ static int rm_read_extradata(AVIOContext *pb, AVCodecContext *avctx, unsigned si
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void rm_read_metadata(AVFormatContext *s, int wide)
|
||||
static void rm_read_metadata(AVFormatContext *s, AVIOContext *pb, int wide)
|
||||
{
|
||||
char buf[1024];
|
||||
int i;
|
||||
|
||||
for (i=0; i<FF_ARRAY_ELEMS(ff_rm_metadata); i++) {
|
||||
int len = wide ? avio_rb16(s->pb) : avio_r8(s->pb);
|
||||
get_strl(s->pb, buf, sizeof(buf), len);
|
||||
int len = wide ? avio_rb16(pb) : avio_r8(pb);
|
||||
get_strl(pb, buf, sizeof(buf), len);
|
||||
av_dict_set(&s->metadata, ff_rm_metadata[i], buf, 0);
|
||||
}
|
||||
}
|
||||
@@ -134,7 +135,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
||||
avio_skip(pb, 8);
|
||||
bytes_per_minute = avio_rb16(pb);
|
||||
avio_skip(pb, 4);
|
||||
rm_read_metadata(s, 0);
|
||||
rm_read_metadata(s, pb, 0);
|
||||
if ((startpos + header_size) >= avio_tell(pb) + 2) {
|
||||
// fourcc (should always be "lpcJ")
|
||||
avio_r8(pb);
|
||||
@@ -293,7 +294,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, AVIOContext *pb,
|
||||
avio_r8(pb);
|
||||
avio_r8(pb);
|
||||
avio_r8(pb);
|
||||
rm_read_metadata(s, 0);
|
||||
rm_read_metadata(s, pb, 0);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
@@ -516,7 +517,7 @@ static int rm_read_header(AVFormatContext *s)
|
||||
flags = avio_rb16(pb); /* flags */
|
||||
break;
|
||||
case MKTAG('C', 'O', 'N', 'T'):
|
||||
rm_read_metadata(s, 1);
|
||||
rm_read_metadata(s, pb, 1);
|
||||
break;
|
||||
case MKTAG('M', 'D', 'P', 'R'):
|
||||
st = avformat_new_stream(s, NULL);
|
||||
|
@@ -1457,6 +1457,9 @@ static int read_frame_internal(AVFormatContext *s, AVPacket *pkt)
|
||||
st->skip_to_keyframe = 0;
|
||||
if (st->skip_to_keyframe) {
|
||||
av_free_packet(&cur_pkt);
|
||||
if (got_packet) {
|
||||
*pkt = cur_pkt;
|
||||
}
|
||||
got_packet = 0;
|
||||
}
|
||||
}
|
||||
@@ -1859,14 +1862,16 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index, int64_t target_ts,
|
||||
}
|
||||
|
||||
if(ts_max == AV_NOPTS_VALUE){
|
||||
int step= 1024;
|
||||
int64_t step= 1024;
|
||||
int64_t limit;
|
||||
filesize = avio_size(s->pb);
|
||||
pos_max = filesize - 1;
|
||||
do{
|
||||
limit = pos_max;
|
||||
pos_max = FFMAX(0, pos_max - step);
|
||||
ts_max = ff_read_timestamp(s, stream_index, &pos_max, pos_max + step, read_timestamp);
|
||||
ts_max = ff_read_timestamp(s, stream_index, &pos_max, limit, read_timestamp);
|
||||
step += step;
|
||||
}while(ts_max == AV_NOPTS_VALUE && pos_max > 0);
|
||||
}while(ts_max == AV_NOPTS_VALUE && 2*limit > step);
|
||||
if (ts_max == AV_NOPTS_VALUE)
|
||||
return -1;
|
||||
|
||||
|
@@ -195,7 +195,12 @@ cglobal %2_to_%1_%3, 3, 3, 6, dst, src, len
|
||||
add lenq, 2*mmsize/(1<<%4)
|
||||
%endif
|
||||
jl .next
|
||||
%if mmsize == 8
|
||||
emms
|
||||
RET
|
||||
%else
|
||||
REP_RET
|
||||
%endif
|
||||
%endmacro
|
||||
|
||||
%macro PACK_6CH 5-7
|
||||
|
@@ -724,12 +724,13 @@ static av_always_inline void planar_rgb16_to_y(uint8_t *_dst, const uint8_t *_sr
|
||||
int i;
|
||||
const uint16_t **src = (const uint16_t **)_src;
|
||||
uint16_t *dst = (uint16_t *)_dst;
|
||||
int shift = bpc < 16 ? bpc : 14;
|
||||
for (i = 0; i < width; i++) {
|
||||
int g = rdpx(src[0] + i);
|
||||
int b = rdpx(src[1] + i);
|
||||
int r = rdpx(src[2] + i);
|
||||
|
||||
dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14));
|
||||
dst[i] = ((RY * r + GY * g + BY * b + (33 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,13 +792,14 @@ static av_always_inline void planar_rgb16_to_uv(uint8_t *_dstU, uint8_t *_dstV,
|
||||
const uint16_t **src = (const uint16_t **)_src;
|
||||
uint16_t *dstU = (uint16_t *)_dstU;
|
||||
uint16_t *dstV = (uint16_t *)_dstV;
|
||||
int shift = bpc < 16 ? bpc : 14;
|
||||
for (i = 0; i < width; i++) {
|
||||
int g = rdpx(src[0] + i);
|
||||
int b = rdpx(src[1] + i);
|
||||
int r = rdpx(src[2] + i);
|
||||
|
||||
dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14);
|
||||
dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + bpc - 14);
|
||||
dstU[i] = (RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14);
|
||||
dstV[i] = (RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT + bpc - 9))) >> (RGB2YUV_SHIFT + shift - 14);
|
||||
}
|
||||
}
|
||||
#undef rdpx
|
||||
|
Reference in New Issue
Block a user