Commit edae3dbf authored by Michael Niedermayer's avatar Michael Niedermayer

Merge remote-tracking branch 'qatar/master'

* qatar/master: (23 commits)
  h264: hide reference frame errors unless requested
  swscale: split hScale() function pointer into h[cy]Scale().
  Move clipd macros to x86util.asm.
  avconv: reindent.
  avconv: rescue poor abused start_time global.
  avconv: rescue poor abused recording_time global.
  avconv: merge two loops in output_packet().
  avconv: fix broken indentation.
  avconv: get rid of the arbitrary MAX_FILES limit.
  avconv: get rid of the output_streams_for_file vs. ost_table schizophrenia
  avconv: add a wrapper for output AVFormatContexts and merge output_opts into it
  avconv: make itsscale syntax consistent with other options.
  avconv: factor out adding input streams.
  avconv: Factorize combining auto vsync with format.
  avconv: Factorize video resampling.
  avconv: Don't unnecessarily convert ipts to a double.
  ffmpeg: remove unsed variable nopts
  RV3/4 parser: remove unused variable 'off'
  add XMV demuxer
  rmdec: parse FPS in RealMedia properly
  ...

Conflicts:
	avconv.c
	libavformat/version.h
	libswscale/swscale.c
	tests/ref/fate/lmlm4-demux
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 2f53fce3 b490f0c2
...@@ -41,6 +41,7 @@ easier to use. The changes are: ...@@ -41,6 +41,7 @@ easier to use. The changes are:
* Presets in avconv are disabled, because only libx264 used them and * Presets in avconv are disabled, because only libx264 used them and
presets for libx264 can now be specified using a private option presets for libx264 can now be specified using a private option
'-preset <presetname>'. '-preset <presetname>'.
- XMV demuxer
version 0.8: version 0.8:
......
This diff is collapsed.
...@@ -260,6 +260,8 @@ library: ...@@ -260,6 +260,8 @@ library:
@tab Multimedia format used in Westwood Studios games. @tab Multimedia format used in Westwood Studios games.
@item Westwood Studios VQA @tab @tab X @item Westwood Studios VQA @tab @tab X
@tab Multimedia format used in Westwood Studios games. @tab Multimedia format used in Westwood Studios games.
@item XMV @tab @tab X
@tab Microsoft video container used in Xbox games.
@item xWMA @tab @tab X @item xWMA @tab @tab X
@tab Microsoft audio container used by XAudio 2. @tab Microsoft audio container used by XAudio 2.
@item YUV4MPEG pipe @tab X @tab X @item YUV4MPEG pipe @tab X @tab X
......
...@@ -736,7 +736,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) ...@@ -736,7 +736,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
{ {
int i, err; int i, err;
AVFormatContext *ic = NULL; AVFormatContext *ic = NULL;
int nopts = 0;
err = avformat_open_input(&ic, filename, NULL, NULL); err = avformat_open_input(&ic, filename, NULL, NULL);
if (err < 0) if (err < 0)
...@@ -768,9 +767,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) ...@@ -768,9 +767,6 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename)
} else } else
choose_pixel_fmt(st, codec); choose_pixel_fmt(st, codec);
} }
if(st->codec->flags & CODEC_FLAG_BITEXACT)
nopts = 1;
} }
av_close_input_file(ic); av_close_input_file(ic);
...@@ -1725,6 +1721,14 @@ static int output_packet(InputStream *ist, int ist_index, ...@@ -1725,6 +1721,14 @@ static int output_packet(InputStream *ist, int ist_index,
int frame_size; int frame_size;
ost = ost_table[i]; ost = ost_table[i];
/* finish if recording time exhausted */
if (recording_time != INT64_MAX &&
av_compare_ts(ist->pts, AV_TIME_BASE_Q, recording_time + start_time, (AVRational){1, 1000000})
>= 0) {
ist->is_past_recording_time = 1;
continue;
}
if (ost->source_index == ist_index) { if (ost->source_index == ist_index) {
#if CONFIG_AVFILTER #if CONFIG_AVFILTER
frame_available = ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO || frame_available = ist->st->codec->codec_type != AVMEDIA_TYPE_VIDEO ||
...@@ -2804,17 +2808,6 @@ static int transcode(AVFormatContext **output_files, ...@@ -2804,17 +2808,6 @@ static int transcode(AVFormatContext **output_files,
} }
} }
/* finish if recording time exhausted */
if (recording_time != INT64_MAX &&
(pkt.pts != AV_NOPTS_VALUE ?
av_compare_ts(pkt.pts, ist->st->time_base, recording_time + start_time, (AVRational){1, 1000000})
:
av_compare_ts(ist->pts, AV_TIME_BASE_Q, recording_time + start_time, (AVRational){1, 1000000})
)>= 0) {
ist->is_past_recording_time = 1;
goto discard_packet;
}
//fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->st->index, pkt.size); //fprintf(stderr,"read #%d.%d size=%d\n", ist->file_index, ist->st->index, pkt.size);
if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) { if (output_packet(ist, ist_index, ost_table, nb_ostreams, &pkt) < 0) {
......
...@@ -635,6 +635,8 @@ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \ ...@@ -635,6 +635,8 @@ OBJS-$(CONFIG_MPEGVIDEO_PARSER) += mpegvideo_parser.o \
mpeg12.o mpeg12data.o \ mpeg12.o mpeg12data.o \
mpegvideo.o error_resilience.o mpegvideo.o error_resilience.o
OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o OBJS-$(CONFIG_PNM_PARSER) += pnm_parser.o pnm.o
OBJS-$(CONFIG_RV30_PARSER) += rv34_parser.o
OBJS-$(CONFIG_RV40_PARSER) += rv34_parser.o
OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \ OBJS-$(CONFIG_VC1_PARSER) += vc1_parser.o vc1.o vc1data.o \
msmpeg4.o msmpeg4data.o mpeg4video.o \ msmpeg4.o msmpeg4data.o mpeg4video.o \
h263.o mpegvideo.o error_resilience.o h263.o mpegvideo.o error_resilience.o
......
...@@ -409,6 +409,8 @@ void avcodec_register_all(void) ...@@ -409,6 +409,8 @@ void avcodec_register_all(void)
REGISTER_PARSER (MPEGAUDIO, mpegaudio); REGISTER_PARSER (MPEGAUDIO, mpegaudio);
REGISTER_PARSER (MPEGVIDEO, mpegvideo); REGISTER_PARSER (MPEGVIDEO, mpegvideo);
REGISTER_PARSER (PNM, pnm); REGISTER_PARSER (PNM, pnm);
REGISTER_PARSER (RV30, rv30);
REGISTER_PARSER (RV40, rv40);
REGISTER_PARSER (VC1, vc1); REGISTER_PARSER (VC1, vc1);
REGISTER_PARSER (VP3, vp3); REGISTER_PARSER (VP3, vp3);
REGISTER_PARSER (VP8, vp8); REGISTER_PARSER (VP8, vp8);
......
...@@ -655,7 +655,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){ ...@@ -655,7 +655,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
print_short_term(h); print_short_term(h);
print_long_term(h); print_long_term(h);
return err; return h->s.avctx->error_recognition >= FF_ER_EXPLODE ? err : 0;
} }
int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
......
/*
* RV30/40 parser
* Copyright (c) 2011 Konstantin Shishkov
*
* This file is part of Libav.
*
* Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
* @file
* RV30/40 parser
*/
#include "parser.h"
#include "libavutil/intreadwrite.h"
typedef struct {
ParseContext pc;
int64_t key_dts;
int key_pts;
} RV34ParseContext;
static const int rv_to_av_frame_type[4] = {
AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_I, AV_PICTURE_TYPE_P, AV_PICTURE_TYPE_B,
};
static int rv34_parse(AVCodecParserContext *s,
AVCodecContext *avctx,
const uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *buf, int buf_size)
{
RV34ParseContext *pc = s->priv_data;
int type, pts, hdr;
if (buf_size < 13 + *buf * 8) {
*poutbuf = buf;
*poutbuf_size = buf_size;
return buf_size;
}
hdr = AV_RB32(buf + 9 + *buf * 8);
if (avctx->codec_id == CODEC_ID_RV30) {
type = (hdr >> 27) & 3;
pts = (hdr >> 7) & 0x1FFF;
} else {
type = (hdr >> 29) & 3;
pts = (hdr >> 6) & 0x1FFF;
}
if (type != 3 && s->pts != AV_NOPTS_VALUE) {
pc->key_dts = s->pts;
pc->key_pts = pts;
} else {
if (type != 3)
s->pts = pc->key_dts + ((pts - pc->key_pts) & 0x1FFF);
else
s->pts = pc->key_dts - ((pc->key_pts - pts) & 0x1FFF);
}
s->pict_type = rv_to_av_frame_type[type];
*poutbuf = buf;
*poutbuf_size = buf_size;
return buf_size;
}
#ifdef CONFIG_RV30_PARSER
AVCodecParser ff_rv30_parser = {
{ CODEC_ID_RV30 },
sizeof(RV34ParseContext),
NULL,
rv34_parse,
};
#endif
#ifdef CONFIG_RV40_PARSER
AVCodecParser ff_rv40_parser = {
{ CODEC_ID_RV40 },
sizeof(RV34ParseContext),
NULL,
rv34_parse,
};
#endif
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
;****************************************************************************** ;******************************************************************************
%include "x86inc.asm" %include "x86inc.asm"
%include "x86util.asm"
SECTION_RODATA SECTION_RODATA
pb_f: times 16 db 15 pb_f: times 16 db 15
...@@ -1054,39 +1055,6 @@ emu_edge mmx ...@@ -1054,39 +1055,6 @@ emu_edge mmx
; int32_t max, unsigned int len) ; int32_t max, unsigned int len)
;----------------------------------------------------------------------------- ;-----------------------------------------------------------------------------
%macro PMINSD_MMX 3 ; dst, src, tmp
mova %3, %2
pcmpgtd %3, %1
pxor %1, %2
pand %1, %3
pxor %1, %2
%endmacro
%macro PMAXSD_MMX 3 ; dst, src, tmp
mova %3, %1
pcmpgtd %3, %2
pand %1, %3
pandn %3, %2
por %1, %3
%endmacro
%macro CLIPD_MMX 3-4 ; src/dst, min, max, tmp
PMINSD_MMX %1, %3, %4
PMAXSD_MMX %1, %2, %4
%endmacro
%macro CLIPD_SSE2 3-4 ; src/dst, min (float), max (float), unused
cvtdq2ps %1, %1
minps %1, %3
maxps %1, %2
cvtps2dq %1, %1
%endmacro
%macro CLIPD_SSE41 3-4 ; src/dst, min, max, unused
pminsd %1, %3
pmaxsd %1, %2
%endmacro
%macro SPLATD_MMX 1 %macro SPLATD_MMX 1
punpckldq %1, %1 punpckldq %1, %1
%endmacro %endmacro
......
...@@ -305,6 +305,7 @@ OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv.o asfdec.o asf.o asfcry ...@@ -305,6 +305,7 @@ OBJS-$(CONFIG_WTV_DEMUXER) += wtvdec.o wtv.o asfdec.o asf.o asfcry
avlanguage.o mpegts.o isom.o riff.o avlanguage.o mpegts.o isom.o riff.o
OBJS-$(CONFIG_WV_DEMUXER) += wv.o apetag.o OBJS-$(CONFIG_WV_DEMUXER) += wv.o apetag.o
OBJS-$(CONFIG_XA_DEMUXER) += xa.o OBJS-$(CONFIG_XA_DEMUXER) += xa.o
OBJS-$(CONFIG_XMV_DEMUXER) += xmv.o
OBJS-$(CONFIG_XWMA_DEMUXER) += xwma.o riff.o OBJS-$(CONFIG_XWMA_DEMUXER) += xwma.o riff.o
OBJS-$(CONFIG_YOP_DEMUXER) += yop.o OBJS-$(CONFIG_YOP_DEMUXER) += yop.o
OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER) += yuv4mpeg.o OBJS-$(CONFIG_YUV4MPEGPIPE_MUXER) += yuv4mpeg.o
......
...@@ -227,6 +227,7 @@ void av_register_all(void) ...@@ -227,6 +227,7 @@ void av_register_all(void)
REGISTER_DEMUXER (WTV, wtv); REGISTER_DEMUXER (WTV, wtv);
REGISTER_DEMUXER (WV, wv); REGISTER_DEMUXER (WV, wv);
REGISTER_DEMUXER (XA, xa); REGISTER_DEMUXER (XA, xa);
REGISTER_DEMUXER (XMV, xmv);
REGISTER_DEMUXER (XWMA, xwma); REGISTER_DEMUXER (XWMA, xwma);
REGISTER_DEMUXER (YOP, yop); REGISTER_DEMUXER (YOP, yop);
REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe); REGISTER_MUXDEMUX (YUV4MPEGPIPE, yuv4mpegpipe);
......
...@@ -293,20 +293,21 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb, ...@@ -293,20 +293,21 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
// av_log(s, AV_LOG_DEBUG, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0')); // av_log(s, AV_LOG_DEBUG, "%X %X\n", st->codec->codec_tag, MKTAG('R', 'V', '2', '0'));
if (st->codec->codec_id == CODEC_ID_NONE) if (st->codec->codec_id == CODEC_ID_NONE)
goto fail1; goto fail1;
st->codec->width = avio_rb16(pb); st->codec->width = avio_rb16(pb);
st->codec->height = avio_rb16(pb); st->codec->height = avio_rb16(pb);
st->codec->time_base.num= 1; avio_skip(pb, 2); // looks like bits per sample
fps= avio_rb16(pb); avio_skip(pb, 4); // always zero?
st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
avio_rb32(pb); st->need_parsing = AVSTREAM_PARSE_TIMESTAMPS;
avio_skip(pb, 2); fps = avio_rb32(pb);
avio_rb16(pb);
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0) if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
return ret; return ret;
// av_log(s, AV_LOG_DEBUG, "fps= %d fps2= %d\n", fps, fps2); av_reduce(&st->codec->time_base.num, &st->codec->time_base.den,
st->codec->time_base.den = fps * st->codec->time_base.num; 0x10000, fps, (1 << 30) - 1);
st->avg_frame_rate.num = st->codec->time_base.den;
st->avg_frame_rate.den = st->codec->time_base.num;
} }
skip: skip:
...@@ -570,7 +571,8 @@ skip: ...@@ -570,7 +571,8 @@ skip:
static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
RMDemuxContext *rm, RMStream *vst, RMDemuxContext *rm, RMStream *vst,
AVPacket *pkt, int len, int *pseq) AVPacket *pkt, int len, int *pseq,
int64_t *timestamp)
{ {
int hdr, seq, pic_num, len2, pos; int hdr, seq, pic_num, len2, pos;
int type; int type;
...@@ -590,8 +592,10 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb, ...@@ -590,8 +592,10 @@ static int rm_assemble_video_frame(AVFormatContext *s, AVIOContext *pb,
return -1; return -1;
rm->remaining_len = len; rm->remaining_len = len;
if(type&1){ // frame, not slice if(type&1){ // frame, not slice
if(type == 3) // frame as a part of packet if(type == 3){ // frame as a part of packet
len= len2; len= len2;
*timestamp = pos;
}
if(rm->remaining_len < len) if(rm->remaining_len < len)
return -1; return -1;
rm->remaining_len -= len; rm->remaining_len -= len;
...@@ -699,7 +703,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, ...@@ -699,7 +703,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
rm->current_stream= st->id; rm->current_stream= st->id;
if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq)) if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq, &timestamp))
return -1; //got partial frame return -1; //got partial frame
} else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
if ((st->codec->codec_id == CODEC_ID_RA_288) || if ((st->codec->codec_id == CODEC_ID_RA_288) ||
...@@ -774,7 +778,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb, ...@@ -774,7 +778,7 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
} }
#endif #endif
pkt->pts= timestamp; pkt->pts = timestamp;
if (flags & 2) if (flags & 2)
pkt->flags |= AV_PKT_FLAG_KEY; pkt->flags |= AV_PKT_FLAG_KEY;
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#include "libavutil/avutil.h" #include "libavutil/avutil.h"
#define LIBAVFORMAT_VERSION_MAJOR 53 #define LIBAVFORMAT_VERSION_MAJOR 53
#define LIBAVFORMAT_VERSION_MINOR 7 #define LIBAVFORMAT_VERSION_MINOR 8
#define LIBAVFORMAT_VERSION_MICRO 0 #define LIBAVFORMAT_VERSION_MICRO 0
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
......
This diff is collapsed.
...@@ -540,3 +540,36 @@ ...@@ -540,3 +540,36 @@
pmaxsw %1, %2 pmaxsw %1, %2
pminsw %1, %3 pminsw %1, %3
%endmacro %endmacro
%macro PMINSD_MMX 3 ; dst, src, tmp
mova %3, %2
pcmpgtd %3, %1
pxor %1, %2
pand %1, %3
pxor %1, %2
%endmacro
%macro PMAXSD_MMX 3 ; dst, src, tmp
mova %3, %1
pcmpgtd %3, %2
pand %1, %3
pandn %3, %2
por %1, %3
%endmacro
%macro CLIPD_MMX 3-4 ; src/dst, min, max, tmp
PMINSD_MMX %1, %3, %4
PMAXSD_MMX %1, %2, %4
%endmacro
%macro CLIPD_SSE2 3-4 ; src/dst, min (float), max (float), unused
cvtdq2ps %1, %1
minps %1, %3
maxps %1, %2
cvtps2dq %1, %1
%endmacro
%macro CLIPD_SSE41 3-4 ; src/dst, min, max, unused
pminsd %1, %3
pmaxsd %1, %2
%endmacro
...@@ -400,7 +400,7 @@ void ff_sws_init_swScale_altivec(SwsContext *c) ...@@ -400,7 +400,7 @@ void ff_sws_init_swScale_altivec(SwsContext *c)
return; return;
if (c->srcBpc == 8 && c->dstBpc <= 10) { if (c->srcBpc == 8 && c->dstBpc <= 10) {
c->hScale = hScale_altivec_real; c->hyScale = c->hcScale = hScale_altivec_real;
} }
if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) && if (!is16BPS(dstFormat) && !is9_OR_10BPS(dstFormat) &&
dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 && dstFormat != PIX_FMT_NV12 && dstFormat != PIX_FMT_NV21 &&
......
...@@ -2212,7 +2212,7 @@ static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth, ...@@ -2212,7 +2212,7 @@ static av_always_inline void hyscale(SwsContext *c, int16_t *dst, int dstWidth,
int shift= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1; int shift= isAnyRGB(c->srcFormat) || c->srcFormat==PIX_FMT_PAL8 ? 13 : av_pix_fmt_descriptors[c->srcFormat].comp[0].depth_minus1;
c->hScale16(dst, dstWidth, (const uint16_t*)src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize, shift); c->hScale16(dst, dstWidth, (const uint16_t*)src, srcW, xInc, hLumFilter, hLumFilterPos, hLumFilterSize, shift);
} else if (!c->hyscale_fast) { } else if (!c->hyscale_fast) {
c->hScale(c, dst, dstWidth, src, hLumFilter, hLumFilterPos, hLumFilterSize); c->hyScale(c, dst, dstWidth, src, hLumFilter, hLumFilterPos, hLumFilterSize);
} else { // fast bilinear upscale / crap downscale } else { // fast bilinear upscale / crap downscale
c->hyscale_fast(c, dst, dstWidth, src, srcW, xInc); c->hyscale_fast(c, dst, dstWidth, src, srcW, xInc);
} }
...@@ -2258,8 +2258,8 @@ static av_always_inline void hcscale(SwsContext *c, int16_t *dst1, int16_t *dst2 ...@@ -2258,8 +2258,8 @@ static av_always_inline void hcscale(SwsContext *c, int16_t *dst1, int16_t *dst2
c->hScale16(dst1, dstWidth, (const uint16_t*)src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift); c->hScale16(dst1, dstWidth, (const uint16_t*)src1, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift);
c->hScale16(dst2, dstWidth, (const uint16_t*)src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift); c->hScale16(dst2, dstWidth, (const uint16_t*)src2, srcW, xInc, hChrFilter, hChrFilterPos, hChrFilterSize, shift);
} else if (!c->hcscale_fast) { } else if (!c->hcscale_fast) {
c->hScale(c, dst1, dstWidth, src1, hChrFilter, hChrFilterPos, hChrFilterSize); c->hcScale(c, dst1, dstWidth, src1, hChrFilter, hChrFilterPos, hChrFilterSize);
c->hScale(c, dst2, dstWidth, src2, hChrFilter, hChrFilterPos, hChrFilterSize); c->hcScale(c, dst2, dstWidth, src2, hChrFilter, hChrFilterPos, hChrFilterSize);
} else { // fast bilinear upscale / crap downscale } else { // fast bilinear upscale / crap downscale
c->hcscale_fast(c, dst1, dst2, dstWidth, src1, src2, srcW, xInc); c->hcscale_fast(c, dst1, dst2, dstWidth, src1, src2, srcW, xInc);
} }
...@@ -2929,16 +2929,16 @@ static av_cold void sws_init_swScale_c(SwsContext *c) ...@@ -2929,16 +2929,16 @@ static av_cold void sws_init_swScale_c(SwsContext *c)
if (c->srcBpc == 8) { if (c->srcBpc == 8) {
if (c->dstBpc <= 10) { if (c->dstBpc <= 10) {
c->hScale = hScale8To15_c; c->hyScale = c->hcScale = hScale8To15_c;
if (c->flags & SWS_FAST_BILINEAR) { if (c->flags & SWS_FAST_BILINEAR) {
c->hyscale_fast = hyscale_fast_c; c->hyscale_fast = hyscale_fast_c;
c->hcscale_fast = hcscale_fast_c; c->hcscale_fast = hcscale_fast_c;
} }
} else { } else {
c->hScale = hScale8To19_c; c->hyScale = c->hcScale = hScale8To19_c;
} }
} else { } else {
c->hScale = c->dstBpc > 10 ? hScale16To19_c : hScale16To15_c; c->hyScale = c->hcScale = c->dstBpc > 10 ? hScale16To19_c : hScale16To15_c;
} }
if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) { if (c->srcRange != c->dstRange && !isAnyRGB(c->dstFormat)) {
......
...@@ -483,9 +483,14 @@ typedef struct SwsContext { ...@@ -483,9 +483,14 @@ typedef struct SwsContext {
* (and input coefficients thus padded with zeroes) * (and input coefficients thus padded with zeroes)
* to simplify creating SIMD code. * to simplify creating SIMD code.
*/ */
void (*hScale)(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src, /** @{ */
const int16_t *filter, const int16_t *filterPos, void (*hyScale)(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src,
int filterSize); const int16_t *filter, const int16_t *filterPos,
int filterSize);
void (*hcScale)(struct SwsContext *c, int16_t *dst, int dstW, const uint8_t *src,
const int16_t *filter, const int16_t *filterPos,
int filterSize);
/** @} */
void (*hScale16)(int16_t *dst, int dstW, const uint16_t *src, int srcW, void (*hScale16)(int16_t *dst, int dstW, const uint16_t *src, int srcW,
int xInc, const int16_t *filter, const int16_t *filterPos, int xInc, const int16_t *filter, const int16_t *filterPos,
......
...@@ -2474,7 +2474,7 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c) ...@@ -2474,7 +2474,7 @@ static av_cold void RENAME(sws_init_swScale)(SwsContext *c)
if (c->srcBpc == 8 && c->dstBpc <= 10) { if (c->srcBpc == 8 && c->dstBpc <= 10) {
#if !COMPILE_TEMPLATE_MMX2 #if !COMPILE_TEMPLATE_MMX2
c->hScale = RENAME(hScale ); c->hyScale = c->hcScale = RENAME(hScale );
#endif /* !COMPILE_TEMPLATE_MMX2 */ #endif /* !COMPILE_TEMPLATE_MMX2 */
// Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one). // Use the new MMX scaler if the MMX2 one can't be used (it is faster than the x86 ASM one).
......
...@@ -62,4 +62,3 @@ ...@@ -62,4 +62,3 @@
0, 171000, 921600, 0x5639e670 0, 171000, 921600, 0x5639e670
1, 171429, 1000, 0xa491f3ef 1, 171429, 1000, 0xa491f3ef
1, 175510, 1000, 0x2c036e18 1, 175510, 1000, 0x2c036e18
1, 179592, 1000, 0x52d65e2a
...@@ -213,4 +213,3 @@ ...@@ -213,4 +213,3 @@
1, 265680, 768, 0xfd6c7597 1, 265680, 768, 0xfd6c7597
0, 267267, 1327, 0x7d15307c 0, 267267, 1327, 0x7d15307c
1, 267840, 768, 0x8d766d40 1, 267840, 768, 0x8d766d40
0, 270270, 1225, 0x1b5d0f5f
This diff is collapsed.
0, 0, 126720, 0xcefaec47 0, 0, 126720, 0xcefaec47
0, 7500, 126720, 0xa416ece5 0, 3003, 126720, 0xa416ece5
0, 15000, 126720, 0xa416ece5 0, 6006, 126720, 0xa416ece5
0, 22500, 126720, 0xa416ece5 0, 9009, 126720, 0xa416ece5
0, 30000, 126720, 0xcc10f4b7 0, 12012, 126720, 0x60d6ed27
0, 37500, 126720, 0xeb6fb8d7 0, 15015, 126720, 0x259af497
0, 45000, 126720, 0xda71b917 0, 18018, 126720, 0x5e6ff4d7
0, 52500, 126720, 0xbb1abbb7 0, 21021, 126720, 0xcc10f4b7
0, 60000, 126720, 0x273fbc37 0, 24024, 126720, 0x763ab817
0, 67500, 126720, 0x16eebbd7 0, 27027, 126720, 0xeb6fb8d7
0, 75000, 126720, 0x105eb927 0, 30030, 126720, 0xda71b917
0, 82500, 126720, 0x7fa3ae27 0, 33033, 126720, 0x0967b8f7
0, 90000, 126720, 0xd115a757 0, 36036, 126720, 0x4b62b947
0, 97500, 126720, 0x04e7897c 0, 39039, 126720, 0xbb1abbb7
0, 105000, 126720, 0x68cfda2b 0, 42042, 126720, 0x273fbc37
0, 112500, 126720, 0xe572dfc9 0, 45045, 126720, 0x16eebbd7
0, 120000, 126720, 0xbc3cc34f 0, 48048, 126720, 0x105eb927
0, 127500, 126720, 0xcf8cb0e2 0, 51051, 126720, 0x7fa3ae27
0, 135000, 126720, 0x75ae61b6 0, 54054, 126720, 0x722e99f7
0, 142500, 126720, 0x554fe3e4 0, 57057, 126720, 0x5ac9a827
0, 150000, 126720, 0x72ecea95 0, 60060, 126720, 0x07beba77
0, 157500, 126720, 0x5d00b5fe 0, 63063, 126720, 0x29d6a887
0, 165000, 126720, 0xe39bba0d 0, 66066, 126720, 0xa5caab87
0, 172500, 126720, 0x9c21bad8 0, 69069, 126720, 0x9ca7aac7
0, 180000, 126720, 0x72f2a47d 0, 72072, 126720, 0xb7debcd7
0, 187500, 126720, 0x4f639ebe 0, 75075, 126720, 0xd115a757
0, 195000, 126720, 0x534a10cc 0, 78078, 126720, 0x6ddaef32
0, 202500, 126720, 0xfdca11d3 0, 81081, 126720, 0xde1bb900
0, 210000, 126720, 0x0c735615 0, 84084, 126720, 0xac6c071b
0, 217500, 126720, 0x0eaf0c1b 0, 87087, 126720, 0x04e7897c
0, 225000, 126720, 0xce5e6794 0, 90090, 126720, 0x5eee050f
0, 232500, 126720, 0x14cf7974 0, 93093, 126720, 0xe675be59
0, 240000, 126720, 0xbc513f2a 0, 96096, 126720, 0xdc3e0837
0, 247500, 126720, 0xbc303fae 0, 99099, 126720, 0x68cfda2b
0, 255000, 126720, 0xd9f67585 0, 102102, 126720, 0xe572dfc9
0, 262500, 126720, 0x3378251f 0, 105105, 126720, 0x582fb176
0, 270000, 126720, 0xb3ed5911 0, 108108, 126720, 0xa9477df0
0, 277500, 126720, 0xc15a3577 0, 111111, 126720, 0xbc3cc34f
0, 285000, 126720, 0x0a24f256 0, 114114, 126720, 0xcf8cb0e2
0, 292500, 126720, 0xfab9c45d 0, 117117, 126720, 0xcff1db35
0, 300000, 126720, 0x45464610 0, 120120, 126720, 0xc6e10f9f
0, 307500, 126720, 0xfe2e057d 0, 123123, 126720, 0x75ae61b6
0, 315000, 126720, 0x23efdc35 0, 126126, 126720, 0x12af3119
0, 322500, 126720, 0x4d888b2e 0, 129129, 126720, 0x85597543
0, 330000, 126720, 0xdd0d74df 0, 132132, 126720, 0x68c27aca
0, 337500, 126720, 0x08382b8e 0, 135135, 126720, 0x554fe3e4
0, 138138, 126720, 0x72ecea95
0, 141141, 126720, 0xf4d003d1
0, 144144, 126720, 0x9bf6a605
0, 147147, 126720, 0x5d00b5fe
0, 150150, 126720, 0x93f7b040
0, 153153, 126720, 0x0d6ad154
0, 156156, 126720, 0x4be8b4ea
0, 159159, 126720, 0xe39bba0d
0, 162162, 126720, 0x9c21bad8
0, 165165, 126720, 0xa567f25b
0, 168168, 126720, 0x7a82663a
0, 171171, 126720, 0x72f2a47d
0, 174174, 126720, 0x4f639ebe
0, 177177, 126720, 0xab0fce83
0, 180180, 126720, 0x6cf87d39
0, 183183, 126720, 0x534a10cc
0, 186186, 126720, 0x6bbcf44c
0, 189189, 126720, 0xfdca11d3
0, 192192, 126720, 0x7e58f5a6
0, 195195, 126720, 0x5fd753d8
0, 198198, 126720, 0x0c735615
0, 201201, 126720, 0x2a034ebf
0, 204204, 126720, 0xeaf3dd0b
0, 207207, 126720, 0x0eaf0c1b
0, 210210, 126720, 0xce5e6794
0, 213213, 126720, 0xf27c31c3
0, 216216, 126720, 0xb64af168
0, 219219, 126720, 0x14cf7974
0, 222222, 126720, 0x1c2a513d
0, 225225, 126720, 0xa3f515ab
0, 228228, 126720, 0xcfd62765
0, 231231, 126720, 0xbc513f2a
0, 234234, 126720, 0xbc303fae
0, 237237, 126720, 0x2f8f69b9
0, 240240, 126720, 0x0a22cc69
0, 243243, 126720, 0xd9f67585
0, 246246, 126720, 0x20403001
0, 249249, 126720, 0xf92b2a25
0, 252252, 126720, 0x3c170aad
0, 255255, 126720, 0x3378251f
0, 258258, 126720, 0xb3ed5911
0, 261261, 126720, 0x35d24ef8
0, 264264, 126720, 0x8da30275
0, 267267, 126720, 0xc15a3577
0, 270270, 126720, 0xf2942f53
0, 273273, 126720, 0x44d8304a
0, 276276, 126720, 0xd688a932
0, 279279, 126720, 0x0a24f256
0, 282282, 126720, 0xfab9c45d
0, 285285, 126720, 0x10e939ce
0, 288288, 126720, 0x97fcaa3a
0, 291291, 126720, 0x45464610
0, 294294, 126720, 0xfe2e057d
0, 297297, 126720, 0x0b6718ae
0, 300300, 126720, 0x5284da7b
0, 303303, 126720, 0x23efdc35
0, 306306, 126720, 0xc387b2b3
0, 309309, 126720, 0xc9e92bf1
0, 312312, 126720, 0xfbf20a01
0, 315315, 126720, 0x4d888b2e
0, 318318, 126720, 0xdd0d74df
0, 321321, 126720, 0x49d07aa4
0, 324324, 126720, 0x08382b8e
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment