mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1266129 - Upgrade ffvpx to 3.0.2. . r=ajones
--HG-- extra : amend_source : b82278fcfd71b4d7b0e37bb7b10f735cc770a59c
This commit is contained in:
parent
e67b36376c
commit
b21b1c955b
@ -1,6 +1,6 @@
|
||||
This directory contains files used in gecko builds from FFmpeg
|
||||
(http://ffmpeg.org). The current files are from FFmpeg as of
|
||||
revision n3.0-1-g0aa2fbd
|
||||
revision n3.0.2
|
||||
All source files match their path from the library's source archive.
|
||||
|
||||
Currently, we only use the vp8 and vp9 portion of the library, and only on x86
|
||||
|
@ -401,10 +401,12 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p = pkt->data + pkt->size - 8 - 5;
|
||||
for (i=1; ; i++){
|
||||
size = AV_RB32(p);
|
||||
if (size>INT_MAX || p - pkt->data < size)
|
||||
if (size>INT_MAX - 5 || p - pkt->data < size)
|
||||
return 0;
|
||||
if (p[4]&128)
|
||||
break;
|
||||
if (p - pkt->data < size + 5)
|
||||
return 0;
|
||||
p-= size+5;
|
||||
}
|
||||
|
||||
@ -415,7 +417,7 @@ int av_packet_split_side_data(AVPacket *pkt){
|
||||
p= pkt->data + pkt->size - 8 - 5;
|
||||
for (i=0; ; i++){
|
||||
size= AV_RB32(p);
|
||||
av_assert0(size<=INT_MAX && p - pkt->data >= size);
|
||||
av_assert0(size<=INT_MAX - 5 && p - pkt->data >= size);
|
||||
pkt->side_data[i].data = av_mallocz(size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
pkt->side_data[i].size = size;
|
||||
pkt->side_data[i].type = p[4]&127;
|
||||
|
@ -291,12 +291,6 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
|
||||
short *output_bak = NULL;
|
||||
int lenout;
|
||||
|
||||
if (s->input_channels == s->output_channels && s->ratio == 1.0 && 0) {
|
||||
/* nothing to do */
|
||||
memcpy(output, input, nb_samples * s->input_channels * sizeof(short));
|
||||
return nb_samples;
|
||||
}
|
||||
|
||||
if (s->sample_fmt[0] != AV_SAMPLE_FMT_S16) {
|
||||
int istride[1] = { s->sample_size[0] };
|
||||
int ostride[1] = { 2 };
|
||||
|
@ -94,7 +94,7 @@ static const struct {
|
||||
{ "6.0(front)", 6, AV_CH_LAYOUT_6POINT0_FRONT },
|
||||
{ "hexagonal", 6, AV_CH_LAYOUT_HEXAGONAL },
|
||||
{ "6.1", 7, AV_CH_LAYOUT_6POINT1 },
|
||||
{ "6.1", 7, AV_CH_LAYOUT_6POINT1_BACK },
|
||||
{ "6.1(back)", 7, AV_CH_LAYOUT_6POINT1_BACK },
|
||||
{ "6.1(front)", 7, AV_CH_LAYOUT_6POINT1_FRONT },
|
||||
{ "7.0", 7, AV_CH_LAYOUT_7POINT0 },
|
||||
{ "7.0(front)", 7, AV_CH_LAYOUT_7POINT0_FRONT },
|
||||
|
@ -41,6 +41,16 @@
|
||||
b_add = FIX(1.77200*255.0/224.0) * cb + ONE_HALF;\
|
||||
}
|
||||
|
||||
#define YUV_TO_RGB1_CCIR_BT709(cb1, cr1)\
|
||||
{\
|
||||
cb = (cb1) - 128;\
|
||||
cr = (cr1) - 128;\
|
||||
r_add = FIX(1.5747*255.0/224.0) * cr + ONE_HALF;\
|
||||
g_add = - FIX(0.1873*255.0/224.0) * cb - FIX(0.4682*255.0/224.0) * cr + \
|
||||
ONE_HALF;\
|
||||
b_add = FIX(1.8556*255.0/224.0) * cb + ONE_HALF;\
|
||||
}
|
||||
|
||||
#define YUV_TO_RGB2_CCIR(r, g, b, y1)\
|
||||
{\
|
||||
y = ((y1) - 16) * FIX(255.0/219.0);\
|
||||
|
@ -313,6 +313,22 @@ static av_always_inline float ff_exp10f(float x)
|
||||
return exp2f(M_LOG2_10 * x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute x^y for floating point x, y. Note: this function is faster than the
|
||||
* libm variant due to mainly 2 reasons:
|
||||
* 1. It does not handle any edge cases. In particular, this is only guaranteed
|
||||
* to work correctly for x > 0.
|
||||
* 2. It is not as accurate as a standard nearly "correctly rounded" libm variant.
|
||||
* @param x base
|
||||
* @param y exponent
|
||||
* @return x^y
|
||||
*/
|
||||
static av_always_inline float ff_fast_powf(float x, float y)
|
||||
{
|
||||
return expf(logf(x) * y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A wrapper for open() setting O_CLOEXEC.
|
||||
*/
|
||||
|
@ -2275,6 +2275,7 @@ enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt)
|
||||
#define FF_COLOR_GRAY 1 /**< gray color space */
|
||||
#define FF_COLOR_YUV 2 /**< YUV color space. 16 <= Y <= 235, 16 <= U, V <= 240 */
|
||||
#define FF_COLOR_YUV_JPEG 3 /**< YUV color space. 0 <= Y <= 255, 0 <= U, V <= 255 */
|
||||
#define FF_COLOR_XYZ 4
|
||||
|
||||
#define pixdesc_has_alpha(pixdesc) \
|
||||
((pixdesc)->nb_components == 2 || (pixdesc)->nb_components == 4 || (pixdesc)->flags & AV_PIX_FMT_FLAG_PAL)
|
||||
@ -2290,6 +2291,9 @@ static int get_color_type(const AVPixFmtDescriptor *desc) {
|
||||
if(desc->name && !strncmp(desc->name, "yuvj", 4))
|
||||
return FF_COLOR_YUV_JPEG;
|
||||
|
||||
if(desc->name && !strncmp(desc->name, "xyz", 3))
|
||||
return FF_COLOR_XYZ;
|
||||
|
||||
if(desc->flags & AV_PIX_FMT_FLAG_RGB)
|
||||
return FF_COLOR_RGB;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user