summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-05-13 04:40:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-05-13 04:40:40 +0200
commit72153419b52c96b1ed4a1bfb7e7793ddde7d71b2 (patch)
tree2e5b40aecf44ad40dd0d6bf122fd8918a889805e
parent410ca3bc2d5e95078f3d6698a2f9e53c2fd24f95 (diff)
parent552a99957f7c6f6ed13795caee7ab7b9deb5d76e (diff)
Merge remote branch 'qatar/master'
* qatar/master: (33 commits) rtpdec_qdm2: Don't try to parse data packet if no configuration is received ac3enc: put the counting of stereo rematrixing bits in the same place to make the code easier to understand. ac3enc: clean up count_frame_bits() and count_frame_bits_fixed() mpegvideo: make FF_DEBUG_DCT_COEFF output coeffs via av_log() instead of just via AVFrame. srtdec: make sure we don't write past the end of buffer wmaenc: improve channel count and bitrate error handling in encode_init() matroskaenc: make sure we don't produce invalid file with no codec ID matroskadec: check that pointers were initialized before accessing them lavf: fix function name in compute_pkt_fields2 av_dlog message lavf: fix av_find_best_stream when providing a wanted stream. lavf: fix av_find_best_stream when decoder_ret is given and using a related stream. ffmpeg: factorize quality calculation tiff: add support for SamplesPerPixel tag in tiff_decode_tag() tiff: Prefer enum TiffCompr over int for TiffContext.compr. mov: Support edit list atom version 1. configure: Enable libpostproc automatically if GPL code is enabled. Cosmetics: fix prototypes in oggdec oggdec: fix memleak with continuous streams. matroskaenc: add missing new line in av_log() call dnxhdenc: add AVClass in private context. ... swscale changes largely rewritten by me or replaced by baptsites due to lots of bugs in ronalds code. Above code is also just in case its not obvios to a large extended duplicates that where cherry picked from ffmpeg. Conflicts: configure ffmpeg.c libavformat/matroskaenc.c libavutil/pixfmt.h libswscale/ppc/swscale_template.c libswscale/swscale.c libswscale/swscale_template.c libswscale/utils.c libswscale/x86/swscale_template.c tests/fate/h264.mak tests/ref/lavfi/pixdesc_le tests/ref/lavfi/pixfmts_copy_le tests/ref/lavfi/pixfmts_null_le tests/ref/lavfi/pixfmts_scale_le tests/ref/lavfi/pixfmts_vflip_le Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rwxr-xr-xconfigure11
-rw-r--r--ffmpeg.c11
-rw-r--r--ffplay.c2
-rw-r--r--ffserver.c2
-rw-r--r--libavcodec/ac3enc.c69
-rw-r--r--libavcodec/cavs.h11
-rw-r--r--libavcodec/cavsdata.h8
-rw-r--r--libavcodec/ffv1.c31
-rw-r--r--libavcodec/jfdctfst.c18
-rw-r--r--libavcodec/jfdctint.c18
-rw-r--r--libavcodec/libxvidff.c3
-rw-r--r--libavcodec/tiff.c122
-rw-r--r--libavcodec/vorbis.c8
-rw-r--r--libavcodec/vorbis.h10
-rw-r--r--libavcodec/vorbisdec.c153
-rw-r--r--libavcodec/vorbisenc.c6
-rw-r--r--libavdevice/bktr.c4
-rw-r--r--libavdevice/x11grab.c2
-rw-r--r--libavformat/applehttp.c1
-rw-r--r--libavformat/applehttpproto.c1
-rw-r--r--libavformat/avio.c3
-rw-r--r--libavformat/isom.h2
-rw-r--r--libavformat/matroskaenc.c2
-rw-r--r--libavformat/mov.c16
-rw-r--r--libavformat/oggdec.c94
-rw-r--r--libavformat/os_support.c1
-rw-r--r--libavformat/rtpdec.c3
-rw-r--r--libavformat/rtpdec_qdm2.c2
-rw-r--r--libavformat/udp.c2
-rw-r--r--libavutil/ppc/cpu.c2
-rw-r--r--libswscale/swscale.c76
-rw-r--r--libswscale/swscale_internal.h1
-rw-r--r--libswscale/swscale_template.c42
-rw-r--r--libswscale/utils.c14
-rw-r--r--tests/fate/h264.mak12
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a20
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a20
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a20
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a38
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a20
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a20
-rw-r--r--tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a20
-rw-r--r--tests/ref/lavfi/pixdesc_le2
-rw-r--r--tests/ref/lavfi/pixfmts_copy_le2
-rw-r--r--tests/ref/lavfi/pixfmts_null_le2
-rw-r--r--tests/ref/lavfi/pixfmts_scale_le2
-rw-r--r--tests/ref/lavfi/pixfmts_vflip_le2
47 files changed, 496 insertions, 435 deletions
diff --git a/configure b/configure
index 2fa0f3aa55..705dde5143 100755
--- a/configure
+++ b/configure
@@ -88,7 +88,7 @@ Configuration options:
--disable-avcodec disable libavcodec build
--disable-avformat disable libavformat build
--disable-swscale disable libswscale build
- --enable-postproc enable GPLed postprocessing support [no]
+ --disable-postproc disable libpostproc build
--disable-avfilter disable video filter support [no]
--disable-pthreads disable pthreads [auto]
--enable-w32threads use Win32 threads [no]
@@ -1497,6 +1497,7 @@ yadif_filter_deps="gpl"
# libraries
avdevice_deps="avcodec avformat"
avformat_deps="avcodec"
+postproc_deps="gpl"
# programs
ffmpeg_deps="avcodec avformat swscale"
@@ -1667,6 +1668,7 @@ enable ffprobe
enable ffserver
enable network
enable optimizations
+enable postproc
enable protocols
enable static
enable stripping
@@ -1689,7 +1691,7 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
CC_O='-o $@'
-host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
+host_cflags='-D_ISOC99_SOURCE -O3 -g -Wall'
host_libs='-lm'
target_path='$(CURDIR)'
@@ -2342,7 +2344,7 @@ if test "$?" != 0; then
die "C compiler test failed."
fi
-add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
+add_cppflags -D_ISOC99_SOURCE
check_cflags -std=c99
check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
@@ -2390,7 +2392,6 @@ case $target_os in
disable symver
oss_indev_extralibs="-lossaudio"
oss_outdev_extralibs="-lossaudio"
- add_cppflags -D_XOPEN_SOURCE=600
;;
openbsd)
enable malloc_aligned
@@ -2484,6 +2485,7 @@ case $target_os in
enable dos_paths
;;
linux)
+ add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
enable dv1394
;;
irix*)
@@ -2559,7 +2561,6 @@ die_license_disabled() {
die_license_disabled gpl libx264
die_license_disabled gpl libxavs
die_license_disabled gpl libxvid
-die_license_disabled gpl postproc
die_license_disabled gpl x11grab
die_license_disabled nonfree libfaac
diff --git a/ffmpeg.c b/ffmpeg.c
index 23413ce5dc..aa16e0a9ad 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/* needed for usleep() */
-#define _XOPEN_SOURCE 600
-
#include "config.h"
#include <ctype.h>
#include <string.h>
@@ -1404,11 +1401,11 @@ static void print_report(AVFormatContext **output_files,
ti1 = 1e10;
vid = 0;
for(i=0;i<nb_ostreams;i++) {
- float q= -1;
+ float q = -1;
ost = ost_table[i];
enc = ost->st->codec;
- if(!ost->st->stream_copy && enc->coded_frame)
- q= enc->coded_frame->quality/(float)FF_QP2LAMBDA;
+ if (!ost->st->stream_copy && enc->coded_frame)
+ q = enc->coded_frame->quality/(float)FF_QP2LAMBDA;
if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
}
@@ -1422,7 +1419,7 @@ static void print_report(AVFormatContext **output_files,
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
if(qp_hist){
int j;
- int qp= lrintf(q);
+ int qp = lrintf(q);
if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram))
qp_histogram[qp]++;
for(j=0; j<32; j++)
diff --git a/ffplay.c b/ffplay.c
index 60b6207d45..28c0c8ec3f 100644
--- a/ffplay.c
+++ b/ffplay.c
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _XOPEN_SOURCE 600
-
#include "config.h"
#include <inttypes.h>
#include <math.h>
diff --git a/ffserver.c b/ffserver.c
index 124a715bee..81c9fcf448 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -19,8 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _XOPEN_SOURCE 600
-
#include "config.h"
#if !HAVE_CLOSESOCKET
#define closesocket close
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 90d65bf44d..eb5a0f94e3 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -791,35 +791,53 @@ static void count_frame_bits_fixed(AC3EncodeContext *s)
* no auxilliary data
*/
- /* header size */
+ /* header */
frame_bits = 65;
frame_bits += frame_bits_inc[s->channel_mode];
/* audio blocks */
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
- frame_bits += s->fbw_channels * 2 + 2; /* blksw * c, dithflag * c, dynrnge, cplstre */
- if (s->channel_mode == AC3_CHMODE_STEREO) {
- frame_bits++; /* rematstr */
- }
- frame_bits += 2 * s->fbw_channels; /* chexpstr[2] * c */
+ /* block switch flags */
+ frame_bits += s->fbw_channels;
+
+ /* dither flags */
+ frame_bits += s->fbw_channels;
+
+ /* dynamic range */
+ frame_bits++;
+
+ /* coupling strategy */
+ frame_bits++;
+ if (!blk)
+ frame_bits++;
+
+ /* exponent strategy */
+ frame_bits += 2 * s->fbw_channels;
if (s->lfe_on)
- frame_bits++; /* lfeexpstr */
- frame_bits++; /* baie */
- frame_bits++; /* snr */
- frame_bits += 2; /* delta / skip */
+ frame_bits++;
+
+ /* bit allocation params */
+ frame_bits++;
+ if (!blk)
+ frame_bits += 2 + 2 + 2 + 2 + 3;
+
+ /* snr offsets and fast gain codes */
+ frame_bits++;
+ if (!blk)
+ frame_bits += 6 + s->channels * (4 + 3);
+
+ /* delta bit allocation */
+ frame_bits++;
+
+ /* skipped data */
+ frame_bits++;
}
- frame_bits++; /* cplinu for block 0 */
- /* bit alloc info */
- /* sdcycod[2], fdcycod[2], sgaincod[2], dbpbcod[2], floorcod[3] */
- /* csnroffset[6] */
- /* (fsnoffset[4] + fgaincod[4]) * c */
- frame_bits += 2*4 + 3 + 6 + s->channels * (4 + 3);
- /* auxdatae, crcrsv */
- frame_bits += 2;
+ /* auxiliary data */
+ frame_bits++;
/* CRC */
- frame_bits += 16;
+ frame_bits += 1 + 16;
s->frame_bits_fixed = frame_bits;
}
@@ -869,6 +887,7 @@ static void count_frame_bits(AC3EncodeContext *s)
int blk, ch;
int frame_bits = 0;
+ /* header */
if (opt->audio_production_info)
frame_bits += 7;
if (s->bitstream_id == 6) {
@@ -878,18 +897,22 @@ static void count_frame_bits(AC3EncodeContext *s)
frame_bits += 14;
}
+ /* audio blocks */
for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
/* stereo rematrixing */
- if (s->channel_mode == AC3_CHMODE_STEREO &&
- s->blocks[blk].new_rematrixing_strategy) {
- frame_bits += s->num_rematrixing_bands;
+ if (s->channel_mode == AC3_CHMODE_STEREO) {
+ frame_bits++;
+ if (s->blocks[blk].new_rematrixing_strategy)
+ frame_bits += s->num_rematrixing_bands;
}
+ /* bandwidth codes & gain range */
for (ch = 0; ch < s->fbw_channels; ch++) {
if (s->exp_strategy[ch][blk] != EXP_REUSE)
- frame_bits += 6 + 2; /* chbwcod[6], gainrng[2] */
+ frame_bits += 6 + 2;
}
}
+
s->frame_bits = s->frame_bits_fixed + frame_bits;
}
diff --git a/libavcodec/cavs.h b/libavcodec/cavs.h
index e84d318977..cb4ab2630b 100644
--- a/libavcodec/cavs.h
+++ b/libavcodec/cavs.h
@@ -233,15 +233,16 @@ extern const struct dec_2dvlc ff_cavs_chroma_dec[5];
extern const uint8_t ff_cavs_chroma_qp[64];
extern const uint8_t ff_cavs_scan3x3[4];
extern const uint8_t ff_cavs_partition_flags[30];
-extern const int_fast8_t ff_left_modifier_l[8];
-extern const int_fast8_t ff_top_modifier_l[8];
-extern const int_fast8_t ff_left_modifier_c[7];
-extern const int_fast8_t ff_top_modifier_c[7];
+extern const int8_t ff_left_modifier_l[8];
+extern const int8_t ff_top_modifier_l[8];
+extern const int8_t ff_left_modifier_c[7];
+extern const int8_t ff_top_modifier_c[7];
extern const cavs_vector ff_cavs_intra_mv;
extern const cavs_vector ff_cavs_un_mv;
extern const cavs_vector ff_cavs_dir_mv;
-static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
+static inline void modify_pred(const int8_t *mod_table, int *mode)
+{
*mode = mod_table[*mode];
if(*mode < 0) {
av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
diff --git a/libavcodec/cavsdata.h b/libavcodec/cavsdata.h
index 9e52fd5cc4..a93405d380 100644
--- a/libavcodec/cavsdata.h
+++ b/libavcodec/cavsdata.h
@@ -497,9 +497,9 @@ static const uint8_t tc_tab[64] = {
5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
};
-const int_fast8_t ff_left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
-const int_fast8_t ff_top_modifier_l[8] = {-1, 1, 5,-1,-1, 5, 7, 7};
-const int_fast8_t ff_left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
-const int_fast8_t ff_top_modifier_c[7] = { 4, 1,-1,-1, 4, 6, 6};
+const int8_t ff_left_modifier_l[8] = { 0, -1, 6, -1, -1, 7, 6, 7 };
+const int8_t ff_top_modifier_l[8] = { -1, 1, 5, -1, -1, 5, 7, 7 };
+const int8_t ff_left_modifier_c[7] = { 5, -1, 2, -1, 6, 5, 6 };
+const int8_t ff_top_modifier_c[7] = { 4, 1, -1, -1, 4, 6, 6 };
#endif /* AVCODEC_CAVSDATA_H */
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c
index 8c1e3d301f..4e0e5f7b62 100644
--- a/libavcodec/ffv1.c
+++ b/libavcodec/ffv1.c
@@ -250,7 +250,7 @@ typedef struct FFV1Context{
uint8_t (*initial_states[MAX_QUANT_TABLES])[32];
int run_index;
int colorspace;
- int_fast16_t *sample_buffer;
+ int16_t *sample_buffer;
int gob_count;
int packed_at_lsb;
@@ -280,7 +280,8 @@ static av_always_inline int fold(int diff, int bits){
return diff;
}
-static inline int predict(int_fast16_t *src, int_fast16_t *last){
+static inline int predict(int16_t *src, int16_t *last)
+{
const int LT= last[-1];
const int T= last[ 0];
const int L = src[-1];
@@ -288,7 +289,9 @@ static inline int predict(int_fast16_t *src, int_fast16_t *last){
return mid_pred(L, L + T - LT, T);
}
-static inline int get_context(PlaneContext *p, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
+static inline int get_context(PlaneContext *p, int16_t *src,
+ int16_t *last, int16_t *last2)
+{
const int LT= last[-1];
const int T= last[ 0];
const int RT= last[ 1];
@@ -507,7 +510,10 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
}
#if CONFIG_FFV1_ENCODER
-static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
+static av_always_inline int encode_line(FFV1Context *s, int w,
+ int16_t *sample[2],
+ int plane_index, int bits)
+{
PlaneContext * const p= &s->plane[plane_index];
RangeCoder * const c= &s->c;
int x;
@@ -592,7 +598,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sam
static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
int x,y,i;
const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t *sample[3];
+ int16_t *sample[3];
s->run_index=0;
memset(s->sample_buffer, 0, ring_size*(w+6)*sizeof(*s->sample_buffer));
@@ -628,7 +634,7 @@ static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
int x, y, p, i;
const int ring_size= s->avctx->context_model ? 3 : 2;
- int_fast16_t *sample[3][3];
+ int16_t *sample[3][3];
s->run_index=0;
memset(s->sample_buffer, 0, ring_size*3*(w+6)*sizeof(*s->sample_buffer));
@@ -1318,7 +1324,10 @@ static av_cold int common_end(AVCodecContext *avctx){
return 0;
}
-static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
+static av_always_inline void decode_line(FFV1Context *s, int w,
+ int16_t *sample[2],
+ int plane_index, int bits)
+{
PlaneContext * const p= &s->plane[plane_index];
RangeCoder * const c= &s->c;
int x;
@@ -1378,7 +1387,7 @@ static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sa
static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
int x, y;
- int_fast16_t *sample[2];
+ int16_t *sample[2];
sample[0]=s->sample_buffer +3;
sample[1]=s->sample_buffer+w+6+3;
@@ -1387,7 +1396,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
memset(s->sample_buffer, 0, 2*(w+6)*sizeof(*s->sample_buffer));
for(y=0; y<h; y++){
- int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
+ int16_t *temp = sample[0]; //FIXME try a normal buffer
sample[0]= sample[1];
sample[1]= temp;
@@ -1419,7 +1428,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
int x, y, p;
- int_fast16_t *sample[3][2];
+ int16_t *sample[3][2];
for(x=0; x<3; x++){
sample[x][0] = s->sample_buffer + x*2 *(w+6) + 3;
sample[x][1] = s->sample_buffer + (x*2+1)*(w+6) + 3;
@@ -1431,7 +1440,7 @@ static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int st
for(y=0; y<h; y++){
for(p=0; p<3; p++){
- int_fast16_t *temp= sample[p][0]; //FIXME try a normal buffer
+ int16_t *temp = sample[p][0]; //FIXME try a normal buffer
sample[p][0]= sample[p][1];
sample[p][1]= temp;
diff --git a/libavcodec/jfdctfst.c b/libavcodec/jfdctfst.c
index b911909ec3..8d3448a676 100644
--- a/libavcodec/jfdctfst.c
+++ b/libavcodec/jfdctfst.c
@@ -145,9 +145,9 @@
#define MULTIPLY(var,const) ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
static av_always_inline void row_fdct(DCTELEM * data){
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1, z2, z3, z4, z5, z11, z13;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int ctr;
@@ -209,9 +209,9 @@ static av_always_inline void row_fdct(DCTELEM * data){
GLOBAL(void)
fdct_ifast (DCTELEM * data)
{
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1, z2, z3, z4, z5, z11, z13;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1, z2, z3, z4, z5, z11, z13;
DCTELEM *dataptr;
int ctr;
@@ -275,9 +275,9 @@ fdct_ifast (DCTELEM * data)
GLOBAL(void)
fdct_ifast248 (DCTELEM * data)
{
- int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast16_t tmp10, tmp11, tmp12, tmp13;
- int_fast16_t z1;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1;
DCTELEM *dataptr;
int ctr;
diff --git a/libavcodec/jfdctint.c b/libavcodec/jfdctint.c
index f6e8c4e939..072c7440b5 100644
--- a/libavcodec/jfdctint.c
+++ b/libavcodec/jfdctint.c
@@ -181,9 +181,9 @@
static av_always_inline void row_fdct(DCTELEM * data){
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1, z2, z3, z4, z5;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
@@ -259,9 +259,9 @@ static av_always_inline void row_fdct(DCTELEM * data){
GLOBAL(void)
ff_jpeg_fdct_islow (DCTELEM * data)
{
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1, z2, z3, z4, z5;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1, z2, z3, z4, z5;
DCTELEM *dataptr;
int ctr;
@@ -345,9 +345,9 @@ ff_jpeg_fdct_islow (DCTELEM * data)
GLOBAL(void)
ff_fdct248_islow (DCTELEM * data)
{
- int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
- int_fast32_t tmp10, tmp11, tmp12, tmp13;
- int_fast32_t z1;
+ int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
+ int tmp10, tmp11, tmp12, tmp13;
+ int z1;
DCTELEM *dataptr;
int ctr;
diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c
index 768dbfe6f9..9b5c17c59d 100644
--- a/libavcodec/libxvidff.c
+++ b/libavcodec/libxvidff.c
@@ -25,9 +25,6 @@
* @author Adam Thayer (krevnik@comcast.net)
*/
-/* needed for mkstemp() */
-#define _XOPEN_SOURCE 600
-
#include <xvid.h>
#include <unistd.h>
#include "avcodec.h"
diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 7e7ae0f007..587ddc604f 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -38,7 +38,7 @@ typedef struct TiffContext {
AVFrame picture;
int width, height;
- unsigned int bpp;
+ unsigned int bpp, bppcount;
int le;
enum TiffCompr compr;
int invert;
@@ -214,6 +214,55 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
return 0;
}
+static int init_image(TiffContext *s)
+{
+ int i, ret;
+ uint32_t *pal;
+
+ switch (s->bpp * 10 + s->bppcount) {
+ case 11:
+ s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
+ break;
+ case 81:
+ s->avctx->pix_fmt = PIX_FMT_PAL8;
+ break;
+ case 243:
+ s->avctx->pix_fmt = PIX_FMT_RGB24;
+ break;
+ case 161:
+ s->avctx->pix_fmt = PIX_FMT_GRAY16BE;
+ break;
+ case 324:
+ s->avctx->pix_fmt = PIX_FMT_RGBA;
+ break;
+ case 483:
+ s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;
+ break;
+ default:
+ av_log(s->avctx, AV_LOG_ERROR,
+ "This format is not supported (bpp=%d, bppcount=%d)\n",
+ s->bpp, s->bppcount);
+ return AVERROR_INVALIDDATA;
+ }
+ if (s->width != s->avctx->width || s->height != s->avctx->height) {
+ if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
+ return ret;
+ avcodec_set_dimensions(s->avctx, s->width, s->height);
+ }
+ if (s->picture.data[0])
+ s->avctx->release_buffer(s->avctx, &s->picture);
+ if ((ret = s->avctx->get_buffer(s->avctx, &s->picture)) < 0) {
+ av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
+ return ret;
+ }
+ if (s->bpp == 8 && s->picture.data[1]){
+ /* make default grayscale pal */
+ pal = (uint32_t *) s->picture.data[1];
+ for (i = 0; i < 256; i++)
+ pal[i] = i * 0x010101;
+ }
+ return 0;
+}
static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *buf, const uint8_t *end_buf)
{
@@ -267,6 +316,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
s->height = value;
break;
case TIFF_BPP:
+ s->bppcount = count;
if(count > 4){
av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count);
return -1;
@@ -286,46 +336,16 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
s->bpp = -1;
}
}
- switch(s->bpp*10 + count){
- case 11:
- s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
- break;
- case 81:
- s->avctx->pix_fmt = PIX_FMT_PAL8;
- break;
- case 243:
- s->avctx->pix_fmt = PIX_FMT_RGB24;
- break;
- case 161:
- s->avctx->pix_fmt = PIX_FMT_GRAY16BE;
- break;
- case 324:
- s->avctx->pix_fmt = PIX_FMT_RGBA;
- break;
- case 483:
- s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;
- break;
- default:
- av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count);
- return -1;
- }
- if(s->width != s->avctx->width || s->height != s->avctx->height){
- if(av_image_check_size(s->width, s->height, 0, s->avctx))
- return -1;
- avcodec_set_dimensions(s->avctx, s->width, s->height);
- }
- if(s->picture.data[0])
- s->avctx->release_buffer(s->avctx, &s->picture);
- if(s->avctx->get_buffer(s->avctx, &s->picture) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- if(s->bpp == 8){
- /* make default grayscale pal */
- pal = (uint32_t *) s->picture.data[1];
- for(i = 0; i < 256; i++)
- pal[i] = i * 0x010101;
- }
+ break;
+ case TIFF_SAMPLES_PER_PIXEL:
+ if (count != 1) {
+ av_log(s->avctx, AV_LOG_ERROR,
+ "Samples per pixel requires a single value, many provided\n");
+ return AVERROR_INVALIDDATA;
+ }
+ if (s->bppcount == 1)
+ s->bpp *= value;
+ s->bppcount = value;
break;
case TIFF_COMPR:
s->compr = value;
@@ -468,7 +488,7 @@ static int decode_frame(AVCodecContext *avctx,
AVFrame *picture = data;
AVFrame * const p= (AVFrame*)&s->picture;
const uint8_t *orig_buf = buf, *end_buf = buf + buf_size;
- int id, le, off;
+ int id, le, off, ret;
int i, j, entries;
int stride, soff, ssize;
uint8_t *dst;
@@ -509,21 +529,9 @@ static int decode_frame(AVCodecContext *avctx,
return -1;
}
/* now we have the data and may start decoding */
- if(!p->data[0]){
- s->bpp = 1;
- avctx->pix_fmt = PIX_FMT_MONOBLACK;
- if(s->width != s->avctx->width || s->height != s->avctx->height){
- if(av_image_check_size(s->width, s->height, 0, s->avctx))
- return -1;
- avcodec_set_dimensions(s->avctx, s->width, s->height);
- }
- if(s->picture.data[0])
- s->avctx->release_buffer(s->avctx, &s->picture);
- if(s->avctx->get_buffer(s->avctx, &s->picture) < 0){
- av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
- return -1;
- }
- }
+ if ((ret = init_image(s)) < 0)
+ return ret;
+
if(s->strips == 1 && !s->stripsize){
av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
s->stripsize = buf_size - s->stripoff;
diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
index 68acc77ab9..a805452eab 100644
--- a/libavcodec/vorbis.c
+++ b/libavcodec/vorbis.c
@@ -53,9 +53,7 @@ unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
// reasonable to check redundantly.
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
{
- uint_fast32_t exit_at_level[33] = {
- 404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ uint32_t exit_at_level[33] = { 404 };
unsigned i, j, p, code;
@@ -106,7 +104,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
#ifdef V_DEBUG
av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
- init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
+ init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
for (i = 0; i < bits[p]; ++i)
av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
av_log(NULL, AV_LOG_INFO, "\n");
@@ -206,7 +204,7 @@ static void render_line(int x0, int y0, int x1, int y1, float *buf)
}
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- uint_fast16_t *y_list, int *flag,
+ uint16_t *y_list, int *flag,
int multiplier, float *out, int samples)
{
int lx, ly, i;
diff --git a/libavcodec/vorbis.h b/libavcodec/vorbis.h
index 28c1bcf636..15b5d85b36 100644
--- a/libavcodec/vorbis.h
+++ b/libavcodec/vorbis.h
@@ -30,17 +30,17 @@ extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
extern const int64_t ff_vorbis_channel_layouts[9];
typedef struct {
- uint_fast16_t x;
- uint_fast16_t sort;
- uint_fast16_t low;
- uint_fast16_t high;
+ uint16_t x;
+ uint16_t sort;
+ uint16_t low;
+ uint16_t high;
} vorbis_floor1_entry;
void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values);
unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
- uint_fast16_t * y_list, int * flag,
+ uint16_t *y_list, int *flag,
int multiplier, float * out, int samples);
void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 161c54d6bc..f4b743e8ab 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -49,11 +49,11 @@
#include <assert.h>
typedef struct {
- uint_fast8_t dimensions;
- uint_fast8_t lookup_type;
- uint_fast8_t maxdepth;
- VLC vlc;
- float *codevectors;
+ uint8_t dimensions;
+ uint8_t lookup_type;
+ uint8_t maxdepth;
+ VLC vlc;
+ float *codevectors;
unsigned int nb_bits;
} vorbis_codebook;
@@ -65,63 +65,63 @@ typedef
int (* vorbis_floor_decode_func)
(struct vorbis_context_s *, vorbis_floor_data *, float *);
typedef struct {
- uint_fast8_t floor_type;
+ uint8_t floor_type;
vorbis_floor_decode_func decode;
union vorbis_floor_u {
struct vorbis_floor0_s {
- uint_fast8_t order;
- uint_fast16_t rate;
- uint_fast16_t bark_map_size;
- int_fast32_t *map[2];
- uint_fast32_t map_size[2];
- uint_fast8_t amplitude_bits;
- uint_fast8_t amplitude_offset;
- uint_fast8_t num_books;
- uint_fast8_t *book_list;
+ uint8_t order;
+ uint16_t rate;
+ uint16_t bark_map_size;
+ int32_t *map[2];
+ uint32_t map_size[2];
+ uint8_t amplitude_bits;
+ uint8_t amplitude_offset;
+ uint8_t num_books;
+ uint8_t *book_list;
float *lsp;
} t0;
struct vorbis_floor1_s {
- uint_fast8_t partitions;
- uint8_t partition_class[32];
- uint_fast8_t class_dimensions[16];
- uint_fast8_t class_subclasses[16];
- uint_fast8_t class_masterbook[16];
- int_fast16_t subclass_books[16][8];
- uint_fast8_t multiplier;
- uint_fast16_t x_list_dim;
+ uint8_t partitions;
+ uint8_t partition_class[32];
+ uint8_t class_dimensions[16];
+ uint8_t class_subclasses[16];
+ uint8_t class_masterbook[16];
+ int16_t subclass_books[16][8];
+ uint8_t multiplier;
+ uint16_t x_list_dim;
vorbis_floor1_entry *list;
} t1;
} data;
} vorbis_floor;
typedef struct {
- uint_fast16_t type;
- uint_fast32_t begin;
- uint_fast32_t end;
+ uint16_t type;
+ uint32_t begin;
+ uint32_t end;
unsigned partition_size;
- uint_fast8_t classifications;
- uint_fast8_t classbook;
- int_fast16_t books[64][8];
- uint_fast8_t maxpass;
- uint_fast16_t ptns_to_read;
- uint8_t *classifs;
+ uint8_t classifications;
+ uint8_t classbook;
+ int16_t books[64][8];
+ uint8_t maxpass;
+ uint16_t ptns_to_read;
+ uint8_t *classifs;
} vorbis_residue;
typedef struct {
- uint_fast8_t submaps;
- uint_fast16_t coupling_steps;
- uint_fast8_t *magnitude;
- uint_fast8_t *angle;
- uint_fast8_t *mux;
- uint_fast8_t submap_floor[16];
- uint_fast8_t submap_residue[16];
+ uint8_t submaps;
+ uint16_t coupling_steps;
+ uint8_t *magnitude;
+ uint8_t *angle;
+ uint8_t *mux;
+ uint8_t submap_floor[16];
+ uint8_t submap_residue[16];
} vorbis_mapping;
typedef struct {
- uint_fast8_t blockflag;
- uint_fast16_t windowtype;
- uint_fast16_t transformtype;
- uint_fast8_t mapping;
+ uint8_t blockflag;
+ uint16_t windowtype;
+ uint16_t transformtype;
+ uint8_t mapping;
} vorbis_mode;
typedef struct vorbis_context_s {
@@ -131,27 +131,27 @@ typedef struct vorbis_context_s {
FmtConvertContext fmt_conv;
FFTContext mdct[2];
- uint_fast8_t first_frame;
- uint_fast32_t version;
- uint_fast8_t audio_channels;
- uint_fast32_t audio_samplerate;
- uint_fast32_t bitrate_maximum;
- uint_fast32_t bitrate_nominal;
- uint_fast32_t bitrate_minimum;
- uint_fast32_t blocksize[2];
+ uint8_t first_frame;
+ uint32_t version;
+ uint8_t audio_channels;
+ uint32_t audio_samplerate;
+ uint32_t bitrate_maximum;
+ uint32_t bitrate_nominal;
+ uint32_t bitrate_minimum;
+ uint32_t blocksize[2];
const float *win[2];
- uint_fast16_t codebook_count;
+ uint16_t codebook_count;
vorbis_codebook *codebooks;
- uint_fast8_t floor_count;
+ uint8_t floor_count;
vorbis_floor *floors;
- uint_fast8_t residue_count;
+ uint8_t residue_count;
vorbis_residue *residues;
- uint_fast8_t mapping_count;
+ uint8_t mapping_count;
vorbis_mapping *mappings;
- uint_fast8_t mode_count;
+ uint8_t mode_count;
vorbis_mode *modes;
- uint_fast8_t mode_number; // mode number for the current packet
- uint_fast8_t previous_window;
+ uint8_t mode_number; // mode number for the current packet
+ uint8_t previous_window;
float *channel_residues;
float *channel_floors;
float *saved;
@@ -241,7 +241,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
uint8_t *tmp_vlc_bits;
uint32_t *tmp_vlc_codes;
GetBitContext *gb = &vc->gb;
- uint_fast16_t *codebook_multiplicands;
+ uint16_t *codebook_multiplicands;
vc->codebook_count = get_bits(gb, 8) + 1;
@@ -359,7 +359,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
- AV_DEBUG(" multiplicand %d \n", codebook_multiplicands[i]);
+ AV_DEBUG(" multiplicand %u\n", codebook_multiplicands[i]);
}
// Weed out unused vlcs and build codevector vector
@@ -544,7 +544,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
rangemax = (1 << rangebits);
if (rangemax > vc->blocksize[1] / 2) {
av_log(vc->avccontext, AV_LOG_ERROR,
- "Floor value is too large for blocksize: %u (%"PRIuFAST32")\n",
+ "Floor value is too large for blocksize: %u (%"PRIu32")\n",
rangemax, vc->blocksize[1] / 2);
return -1;
}
@@ -652,7 +652,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
for (i = 0; i < vc->residue_count; ++i) {
vorbis_residue *res_setup = &vc->residues[i];
- uint_fast8_t cascade[64];
+ uint8_t cascade[64];
unsigned high_bits, low_bits;
res_setup->type = get_bits(gb, 16);
@@ -666,7 +666,10 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
if (res_setup->begin>res_setup->end ||
res_setup->end > vc->avccontext->channels * vc->blocksize[1] / 2 ||
(res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
- av_log(vc->avccontext, AV_LOG_ERROR, "partition out of bounds: type, begin, end, size, blocksize: %"PRIdFAST16", %"PRIdFAST32", %"PRIdFAST32", %u, %"PRIdFAST32"\n", res_setup->type, res_setup->begin, res_setup->end, res_setup->partition_size, vc->blocksize[1] / 2);
+ av_log(vc->avccontext, AV_LOG_ERROR,
+ "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
+ res_setup->type, res_setup->begin, res_setup->end,
+ res_setup->partition_size, vc->blocksize[1] / 2);
return -1;
}
@@ -790,12 +793,12 @@ static void create_map(vorbis_context *vc, unsigned floor_number)
vorbis_floor0 *vf;
int idx;
int blockflag, n;
- int_fast32_t *map;
+ int32_t *map;
for (blockflag = 0; blockflag < 2; ++blockflag) {
n = vc->blocksize[blockflag] / 2;
floors[floor_number].data.t0.map[blockflag] =
- av_malloc((n+1) * sizeof(int_fast32_t)); // n + sentinel
+ av_malloc((n + 1) * sizeof(int32_t)); // n + sentinel
map = floors[floor_number].data.t0.map[blockflag];
vf = &floors[floor_number].data.t0;
@@ -1145,10 +1148,10 @@ static int vorbis_floor1_decode(vorbis_context *vc,
{
vorbis_floor1 *vf = &vfu->t1;
GetBitContext *gb = &vc->gb;
- uint_fast16_t range_v[4] = { 256, 128, 86, 64 };
- unsigned range = range_v[vf->multiplier-1];
- uint_fast16_t floor1_Y[258];
- uint_fast16_t floor1_Y_final[258];
+ uint16_t range_v[4] = { 256, 128, 86, 64 };
+ unsigned range = range_v[vf->multiplier - 1];
+ uint16_t floor1_Y[258];
+ uint16_t floor1_Y_final[258];
int floor1_flag[258];
unsigned partition_class, cdim, cbits, csub, cval, offset, i, j;
int book, adx, ady, dy, off, predicted, err;
@@ -1250,7 +1253,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
floor1_Y_final[i] = predicted;
}
- AV_DEBUG(" Decoded floor(%d) = %d / val %u\n",
+ AV_DEBUG(" Decoded floor(%d) = %u / val %u\n",
vf->list[i].x, floor1_Y_final[i], val);
}
@@ -1268,7 +1271,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
vorbis_residue *vr,
unsigned ch,
- uint_fast8_t *do_not_decode,
+ uint8_t *do_not_decode,
float *vec,
unsigned vlen,
int vr_type)
@@ -1405,7 +1408,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
unsigned ch,
- uint_fast8_t *do_not_decode,
+ uint8_t *do_not_decode,
float *vec, unsigned vlen)
{
if (vr->type == 2)
@@ -1453,12 +1456,12 @@ static int vorbis_parse_audio_packet(vorbis_context *vc)
unsigned previous_window = vc->previous_window;
unsigned mode_number, blockflag, blocksize;
int i, j;
- uint_fast8_t no_residue[255];
- uint_fast8_t do_not_decode[255];
+ uint8_t no_residue[255];
+ uint8_t do_not_decode[255];
vorbis_mapping *mapping;
float *ch_res_ptr = vc->channel_residues;
float *ch_floor_ptr = vc->channel_floors;
- uint_fast8_t res_chan[255];
+ uint8_t res_chan[255];
unsigned res_num = 0;
int retlen = 0;
diff --git a/libavcodec/vorbisenc.c b/libavcodec/vorbisenc.c
index d15d3454eb..617e2b7cc4 100644
--- a/libavcodec/vorbisenc.c
+++ b/libavcodec/vorbisenc.c
@@ -674,7 +674,7 @@ static float get_floor_average(vorbis_enc_floor * fc, float *coeffs, int i)
}
static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
- float *coeffs, uint_fast16_t *posts, int samples)
+ float *coeffs, uint16_t *posts, int samples)
{
int range = 255 / fc->multiplier + 1;
int i;
@@ -706,7 +706,7 @@ static int render_point(int x0, int y0, int x1, int y1, int x)
}
static void floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
- PutBitContext *pb, uint_fast16_t *posts,
+ PutBitContext *pb, uint16_t *posts,
float *floor, int samples)
{
int range = 255 / fc->multiplier + 1;
@@ -1010,7 +1010,7 @@ static int vorbis_encode_frame(AVCodecContext *avccontext,
for (i = 0; i < venc->channels; i++) {
vorbis_enc_floor *fc = &venc->floors[mapping->floor[mapping->mux[i]]];
- uint_fast16_t posts[MAX_FLOOR_VALUES];
+ uint16_t posts[MAX_FLOOR_VALUES];
floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
}
diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c
index fb5c45c7b6..6378ce7873 100644
--- a/libavdevice/bktr.c
+++ b/libavdevice/bktr.c
@@ -24,10 +24,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#define _BSD_SOURCE 1
-#define _NETBSD_SOURCE
-#define _XOPEN_SOURCE 600
-
#include "libavformat/avformat.h"
#if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
# include <dev/bktr/ioctl_meteor.h>
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index fdc8a6d22f..090af4930f 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -35,8 +35,6 @@
* and Edouard Gomez <ed.gomez@free.fr>.
*/
-#define _XOPEN_SOURCE 600
-
#include "config.h"
#include "libavformat/avformat.h"
#include <time.h>
diff --git a/libavformat/applehttp.c b/libavformat/applehttp.c
index 4429ad0199..34123d730d 100644
--- a/libavformat/applehttp.c
+++ b/libavformat/applehttp.c
@@ -25,7 +25,6 @@
* http://tools.ietf.org/html/draft-pantos-http-live-streaming
*/
-#define _XOPEN_SOURCE 600
#include "libavutil/avstring.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/opt.h"
diff --git a/libavformat/applehttpproto.c b/libavformat/applehttpproto.c
index 3a4d4b8100..bb5029d82f 100644
--- a/libavformat/applehttpproto.c
+++ b/libavformat/applehttpproto.c
@@ -25,7 +25,6 @@
* http://tools.ietf.org/html/draft-pantos-http-live-streaming
*/
-#define _XOPEN_SOURCE 600
#include "libavutil/avstring.h"
#include "avformat.h"
#include "internal.h"
diff --git a/libavformat/avio.c b/libavformat/avio.c
index 8655c13957..972c5334f3 100644
--- a/libavformat/avio.c
+++ b/libavformat/avio.c
@@ -19,9 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/* needed for usleep() */
-#define _XOPEN_SOURCE 600
#include <unistd.h>
+
#include "libavutil/avstring.h"
#include "libavutil/opt.h"
#include "os_support.h"
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 081d2279ba..99de0c860a 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -109,7 +109,7 @@ typedef struct MOVStreamContext {
unsigned int keyframe_count;
int *keyframes;
int time_scale;
- int time_offset; ///< time offset of the first edit list entry
+ int64_t time_offset; ///< time offset of the first edit list entry
int current_sample;
unsigned int bytes_per_frame;
unsigned int samples_per_frame;
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index 72631c7686..387cead8cd 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -616,7 +616,7 @@ static int mkv_write_tracks(AVFormatContext *s)
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE);
if (!native_id) {
av_log(s, AV_LOG_ERROR, "Subtitle codec %d is not supported.\n", codec->codec_id);
- return AVERROR(EINVAL);
+ return AVERROR(ENOSYS);
}
break;
default:
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 6e29ceaa00..745768f3b9 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2166,13 +2166,13 @@ free_and_return:
static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
{
MOVStreamContext *sc;
- int i, edit_count;
+ int i, edit_count, version;
if (c->fc->nb_streams < 1)
return 0;
sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
- avio_r8(pb); /* version */
+ version = avio_r8(pb); /* version */
avio_rb24(pb); /* flags */
edit_count = avio_rb32(pb); /* entries */
@@ -2180,9 +2180,15 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
return -1;
for(i=0; i<edit_count; i++){
- int time;
- int duration = avio_rb32(pb); /* Track duration */
- time = avio_rb32(pb); /* Media time */
+ int64_t time;
+ int64_t duration;
+ if (version == 1) {
+ duration = avio_rb64(pb);
+ time = avio_rb64(pb);
+ } else {
+ duration = avio_rb32(pb); /* segment duration */
+ time = avio_rb32(pb); /* media time */
+ }
avio_rb32(pb); /* Media rate */
if (i == 0 && time >= -1) {
sc->time_offset = time != -1 ? time : -duration;
diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c
index b9ac3d9f0e..c799ce5205 100644
--- a/libavformat/oggdec.c
+++ b/libavformat/oggdec.c
@@ -56,8 +56,7 @@ static const struct ogg_codec * const ogg_codecs[] = {
};
//FIXME We could avoid some structure duplication
-static int
-ogg_save (AVFormatContext * s)
+static int ogg_save(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
struct ogg_state *ost =
@@ -81,8 +80,7 @@ ogg_save (AVFormatContext * s)
return 0;
}
-static int
-ogg_restore (AVFormatContext * s, int discard)
+static int ogg_restore(AVFormatContext *s, int discard)
{
struct ogg *ogg = s->priv_data;
AVIOContext *bc = s->pb;
@@ -110,8 +108,7 @@ ogg_restore (AVFormatContext * s, int discard)
return 0;
}
-static int
-ogg_reset (struct ogg * ogg)
+static int ogg_reset(struct ogg *ogg)
{
int i;
@@ -135,8 +132,7 @@ ogg_reset (struct ogg * ogg)
return 0;
}
-static const struct ogg_codec *
-ogg_find_codec (uint8_t * buf, int size)
+static const struct ogg_codec *ogg_find_codec(uint8_t *buf, int size)
{
int i;
@@ -148,8 +144,7 @@ ogg_find_codec (uint8_t * buf, int size)
return NULL;
}
-static int
-ogg_new_stream (AVFormatContext * s, uint32_t serial)
+static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
{
struct ogg *ogg = s->priv_data;
@@ -166,17 +161,18 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial)
os->buf = av_malloc(os->bufsize);
os->header = -1;
- st = av_new_stream (s, idx);
- if (!st)
- return AVERROR(ENOMEM);
+ if (new_avstream) {
+ st = av_new_stream(s, idx);
+ if (!st)
+ return AVERROR(ENOMEM);
- av_set_pts_info(st, 64, 1, 1000000);
+ av_set_pts_info(st, 64, 1, 1000000);
+ }
return idx;
}
-static int
-ogg_new_buf(struct ogg *ogg, int idx)
+static int ogg_new_buf(struct ogg *ogg, int idx)
{
struct ogg_stream *os = ogg->streams + idx;
uint8_t *nb = av_malloc(os->bufsize);
@@ -192,8 +188,7 @@ ogg_new_buf(struct ogg *ogg, int idx)
return 0;
}
-static int
-ogg_read_page (AVFormatContext * s, int *str)
+static int ogg_read_page(AVFormatContext *s, int *str)
{
AVIOContext *bc = s->pb;
struct ogg *ogg = s->priv_data;
@@ -251,8 +246,10 @@ ogg_read_page (AVFormatContext * s, int *str)
}
ogg->curidx = -1;
ogg->nstreams = 0;
+ idx = ogg_new_stream(s, serial, 0);
+ } else {
+ idx = ogg_new_stream(s, serial, 1);
}
- idx = ogg_new_stream (s, serial);
if (idx < 0)
return -1;
}
@@ -308,8 +305,8 @@ ogg_read_page (AVFormatContext * s, int *str)
return 0;
}
-static int
-ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpos)
+static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
+ int64_t *fpos)
{
struct ogg *ogg = s->priv_data;
int idx, i;
@@ -439,8 +436,7 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
return 0;
}
-static int
-ogg_get_headers (AVFormatContext * s)
+static int ogg_get_headers(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
@@ -456,8 +452,7 @@ ogg_get_headers (AVFormatContext * s)
return 0;
}
-static int
-ogg_get_length (AVFormatContext * s)
+static int ogg_get_length(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
int i;
@@ -505,9 +500,7 @@ ogg_get_length (AVFormatContext * s)
return 0;
}
-
-static int
-ogg_read_header (AVFormatContext * s, AVFormatParameters * ap)
+static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap)
{
struct ogg *ogg = s->priv_data;
int i;
@@ -558,8 +551,7 @@ static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts)
return pts;
}
-static int
-ogg_read_packet (AVFormatContext * s, AVPacket * pkt)
+static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
{
struct ogg *ogg;
struct ogg_stream *os;
@@ -599,9 +591,7 @@ retry:
return psize;
}
-
-static int
-ogg_read_close (AVFormatContext * s)
+static int ogg_read_close(AVFormatContext *s)
{
struct ogg *ogg = s->priv_data;
int i;
@@ -614,10 +604,8 @@ ogg_read_close (AVFormatContext * s)
return 0;
}
-
-static int64_t
-ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
- int64_t pos_limit)
+static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
+ int64_t *pos_arg, int64_t pos_limit)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + stream_index;
@@ -640,7 +628,8 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
return pts;
}
-static int ogg_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
+static int ogg_read_seek(AVFormatContext *s, int stream_index,
+ int64_t timestamp, int flags)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + stream_index;
@@ -660,24 +649,21 @@ static int ogg_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp
static int ogg_probe(AVProbeData *p)
{
- if (p->buf[0] == 'O' && p->buf[1] == 'g' &&
- p->buf[2] == 'g' && p->buf[3] == 'S' &&
- p->buf[4] == 0x0 && p->buf[5] <= 0x7 )
+ if (!memcmp("OggS", p->buf, 5) && p->buf[5] <= 0x7)
return AVPROBE_SCORE_MAX;
- else
- return 0;
+ return 0;
}
AVInputFormat ff_ogg_demuxer = {
- "ogg",
- NULL_IF_CONFIG_SMALL("Ogg"),
- sizeof (struct ogg),
- ogg_probe,
- ogg_read_header,
- ogg_read_packet,
- ogg_read_close,
- ogg_read_seek,
- ogg_read_timestamp,
- .extensions = "ogg",
- .flags = AVFMT_GENERIC_INDEX,
+ .name = "ogg",
+ .long_name = NULL_IF_CONFIG_SMALL("Ogg"),
+ .priv_data_size = sizeof(struct ogg),
+ .read_probe = ogg_probe,
+ .read_header = ogg_read_header,
+ .read_packet = ogg_read_packet,
+ .read_close = ogg_read_close,
+ .read_seek = ogg_read_seek,
+ .read_timestamp = ogg_read_timestamp,
+ .extensions = "ogg",
+ .flags = AVFMT_GENERIC_INDEX,
};
diff --git a/libavformat/os_support.c b/libavformat/os_support.c
index 8afa628515..ac9086c3c3 100644
--- a/libavformat/os_support.c
+++ b/libavformat/os_support.c
@@ -22,7 +22,6 @@
/* needed by inet_aton() */
#define _SVID_SOURCE
-#define _DARWIN_C_SOURCE
#include "config.h"
#include "avformat.h"
diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c
index db728ad2cb..0a9a8bc8d6 100644
--- a/libavformat/rtpdec.c
+++ b/libavformat/rtpdec.c
@@ -19,9 +19,6 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-/* needed for gethostname() */
-#define _XOPEN_SOURCE 600
-
#include "libavcodec/get_bits.h"
#include "avformat.h"
#include "mpegts.h"
diff --git a/libavformat/rtpdec_qdm2.c b/libavformat/rtpdec_qdm2.c
index 1c1d3219be..c4314ec2c4 100644
--- a/libavformat/rtpdec_qdm2.c
+++ b/libavformat/rtpdec_qdm2.c
@@ -266,6 +266,8 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
* to the decoder that it is OK to initialize. */
st->codec->codec_id = CODEC_ID_QDM2;
}
+ if (st->codec->codec_id == CODEC_ID_NONE)
+ return AVERROR(EAGAIN);
/* subpackets */
while (end - p >= 4) {
diff --git a/libavformat/udp.c b/libavformat/udp.c
index 4491c4b049..35c1774635 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -25,7 +25,7 @@
*/
#define _BSD_SOURCE /* Needed for using struct ip_mreq with recent glibc */
-#define _DARWIN_C_SOURCE /* Needed for using IP_MULTICAST_TTL on OS X */
+
#include "avformat.h"
#include "avio_internal.h"
#include "libavutil/parseutils.h"
diff --git a/libavutil/ppc/cpu.c b/libavutil/ppc/cpu.c
index 8db27391c0..fc38be6f65 100644
--- a/libavutil/ppc/cpu.c
+++ b/libavutil/ppc/cpu.c
@@ -17,10 +17,8 @@
*/
#ifdef __APPLE__
-#undef _POSIX_C_SOURCE
#include <sys/sysctl.h>
#elif defined(__OpenBSD__)
-#undef _POSIX_C_SOURCE
#include <sys/param.h>
#include <sys/sysctl.h>
#include <machine/cpu.h>
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 3b9b2dedfd..16379182ac 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1875,23 +1875,23 @@ static int packedCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
return srcSliceH;
}
-#define DITHER_COPY(dst, dstStride, src, srcStride, bswap)\
+#define DITHER_COPY(dst, dstStride, src, srcStride, bswap, dbswap)\
uint16_t scale= dither_scale[dst_depth-1][src_depth-1];\
int shift= src_depth-dst_depth + dither_scale[src_depth-2][dst_depth-1];\
for (i = 0; i < height; i++) {\
uint8_t *dither= dithers[src_depth-9][i&7];\
for (j = 0; j < length-7; j+=8){\
- dst[j+0] = (bswap(src[j+0]) + dither[0])*scale>>shift;\
- dst[j+1] = (bswap(src[j+1]) + dither[1])*scale>>shift;\
- dst[j+2] = (bswap(src[j+2]) + dither[2])*scale>>shift;\
- dst[j+3] = (bswap(src[j+3]) + dither[3])*scale>>shift;\
- dst[j+4] = (bswap(src[j+4]) + dither[4])*scale>>shift;\
- dst[j+5] = (bswap(src[j+5]) + dither[5])*scale>>shift;\
- dst[j+6] = (bswap(src[j+6]) + dither[6])*scale>>shift;\
- dst[j+7] = (bswap(src[j+7]) + dither[7])*scale>>shift;\
+ dst[j+0] = dbswap((bswap(src[j+0]) + dither[0])*scale>>shift);\
+ dst[j+1] = dbswap((bswap(src[j+1]) + dither[1])*scale>>shift);\
+ dst[j+2] = dbswap((bswap(src[j+2]) + dither[2])*scale>>shift);\
+ dst[j+3] = dbswap((bswap(src[j+3]) + dither[3])*scale>>shift);\
+ dst[j+4] = dbswap((bswap(src[j+4]) + dither[4])*scale>>shift);\
+ dst[j+5] = dbswap((bswap(src[j+5]) + dither[5])*scale>>shift);\
+ dst[j+6] = dbswap((bswap(src[j+6]) + dither[6])*scale>>shift);\
+ dst[j+7] = dbswap((bswap(src[j+7]) + dither[7])*scale>>shift);\
}\
for (; j < length; j++)\
- dst[j] = (bswap(src[j]) + dither[j&7])*scale>>shift;\
+ dst[j] = dbswap((bswap(src[j]) + dither[j&7])*scale>>shift);\
dst += dstStride;\
src += srcStride;\
}
@@ -1921,42 +1921,66 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
) {
const int src_depth = av_pix_fmt_descriptors[c->srcFormat].comp[plane].depth_minus1+1;
const int dst_depth = av_pix_fmt_descriptors[c->dstFormat].comp[plane].depth_minus1+1;
- uint16_t *srcPtr2 = (uint16_t*)srcPtr;
+ const uint16_t *srcPtr2 = (const uint16_t*)srcPtr;
uint16_t *dstPtr2 = (uint16_t*)dstPtr;
if (dst_depth == 8) {
if(isBE(c->srcFormat) == HAVE_BIGENDIAN){
- DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, )
+ DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, , )
} else {
- DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, av_bswap16)
+ DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, av_bswap16, )
}
} else if (src_depth == 8) {
for (i = 0; i < height; i++) {
- for (j = 0; j < length; j++)
- dstPtr2[j] = (srcPtr[j]<<(dst_depth-8)) |
- (srcPtr[j]>>(2*8-dst_depth));
+ if(isBE(c->dstFormat)){
+ for (j = 0; j < length; j++)
+ AV_WB16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
+ (srcPtr[j]>>(2*8-dst_depth)));
+ } else {
+ for (j = 0; j < length; j++)
+ AV_WL16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
+ (srcPtr[j]>>(2*8-dst_depth)));
+ }
dstPtr2 += dstStride[plane]/2;
srcPtr += srcStride[plane];
}
} else if (src_depth <= dst_depth) {
for (i = 0; i < height; i++) {
- if(isBE(c->dstFormat)){
- for (j = 0; j < length; j++)
- AV_WB16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
- (srcPtr2[j]>>(2*src_depth-dst_depth)));
- }else{
- for (j = 0; j < length; j++)
- AV_WL16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
- (srcPtr2[j]>>(2*src_depth-dst_depth)));
+#define COPY_UP(r,w) \
+ for (j = 0; j < length; j++){ \
+ unsigned int v= r(&srcPtr2[j]);\
+ w(&dstPtr2[j], (v<<(dst_depth-src_depth)) | \
+ (v>>(2*src_depth-dst_depth)));\
+ }
+ if(isBE(c->srcFormat)){
+ if(isBE(c->dstFormat)){
+ COPY_UP(AV_RB16, AV_WB16)
+ } else {
+ COPY_UP(AV_RB16, AV_WL16)
+ }
+ } else {
+ if(isBE(c->dstFormat)){
+ COPY_UP(AV_RL16, AV_WB16)
+ } else {
+ COPY_UP(AV_RL16, AV_WL16)
+ }
}
dstPtr2 += dstStride[plane]/2;
srcPtr2 += srcStride[plane]/2;
}
} else {
if(isBE(c->srcFormat) == HAVE_BIGENDIAN){
- DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, )
+ if(isBE(c->dstFormat) == HAVE_BIGENDIAN){
+ DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, , )
+ } else {
+ DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, , av_bswap16)
+ }
}else{
- DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16)
+ if(isBE(c->dstFormat) == HAVE_BIGENDIAN){
+ DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16, )
+ } else {
+ DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16, av_bswap16)
+ }
}
}
} else if(is16BPS(c->srcFormat) && is16BPS(c->dstFormat)
diff --git a/libswscale/swscale_internal.h b/libswscale/swscale_internal.h
index ac225fd08f..03c5bf9736 100644
--- a/libswscale/swscale_internal.h
+++ b/libswscale/swscale_internal.h
@@ -358,6 +358,7 @@ const char *sws_format_name(enum PixelFormat format);
|| (x)==PIX_FMT_YUV422P10LE \
|| (x)==PIX_FMT_YUV422P10BE \
)
+#define is9_OR_10BPS isNBPS //for ronald
#define isBE(x) ((x)&1)
#define isPlanar8YUV(x) ( \
(x)==PIX_FMT_YUV410P \
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index c5f3465d29..c1a2d44bbe 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -1678,6 +1678,8 @@ static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s
);
#else
int i;
+ // FIXME I don't think this code is right for YUV444/422, since then h is not subsampled so
+ // we need to skip each second pixel. Same for BEToUV.
for (i=0; i<width; i++) {
dstU[i]= src1[2*i + 1];
dstV[i]= src2[2*i + 1];
@@ -1827,27 +1829,29 @@ static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
}
// FIXME Maybe dither instead.
-#define YUV_NBPS(depth) \
-static inline void RENAME(yuv ## depth ## ToUV)(uint8_t *dstU, uint8_t *dstV, \
- const uint16_t *srcU, const uint16_t *srcV, \
- long width, uint32_t *unused) \
+#define YUV_NBPS(depth, endianness, rfunc) \
+static inline void endianness ## depth ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
+ const uint16_t *srcU, const uint16_t *srcV, \
+ long width, uint32_t *unused) \
{ \
int i; \
for (i = 0; i < width; i++) { \
- dstU[i] = srcU[i]>>(depth-8); \
- dstV[i] = srcV[i]>>(depth-8); \
+ dstU[i] = rfunc(&srcU[i])>>(depth-8); \
+ dstV[i] = rfunc(&srcV[i])>>(depth-8); \
} \
} \
\
-static inline void RENAME(yuv ## depth ## ToY)(uint8_t *dstY, const uint16_t *srcY, long width, uint32_t *unused) \
+static inline void endianness ## depth ## ToY_c(uint8_t *dstY, const uint16_t *srcY, long width, uint32_t *unused) \
{ \
int i; \
for (i = 0; i < width; i++) \
- dstY[i] = srcY[i]>>(depth-8); \
+ dstY[i] = rfunc(&srcY[i])>>(depth-8); \
} \
-YUV_NBPS( 9)
-YUV_NBPS(10)
+YUV_NBPS( 9, LE, AV_RL16)
+YUV_NBPS( 9, BE, AV_RB16)
+YUV_NBPS(10, LE, AV_RL16)
+YUV_NBPS(10, BE, AV_RB16)
#if COMPILE_TEMPLATE_MMX
static inline void RENAME(bgr24ToY_mmx)(uint8_t *dst, const uint8_t *src, long width, enum PixelFormat srcFormat)
@@ -2978,9 +2982,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
case PIX_FMT_PAL8 :
case PIX_FMT_BGR4_BYTE:
case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV; break;
- case PIX_FMT_YUV420P9 : c->chrToYV12 = (void*)RENAME(yuv9ToUV ); break;
- case PIX_FMT_YUV422P10:
- case PIX_FMT_YUV420P10: c->chrToYV12 = (void*)RENAME(yuv10ToUV); break;
+ case PIX_FMT_YUV420P9BE: c->chrToYV12 = BE9ToUV_c; break;
+ case PIX_FMT_YUV420P9LE: c->chrToYV12 = LE9ToUV_c; break;
+ case PIX_FMT_YUV422P10BE:
+ case PIX_FMT_YUV420P10BE: c->chrToYV12 = BE10ToUV_c; break;
+ case PIX_FMT_YUV422P10LE:
+ case PIX_FMT_YUV420P10LE: c->chrToYV12 = LE10ToUV_c; break;
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
case PIX_FMT_YUV444P16BE: c->chrToYV12 = RENAME(BEToUV); break;
@@ -3027,9 +3034,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
c->lumToYV12 = NULL;
c->alpToYV12 = NULL;
switch (srcFormat) {
- case PIX_FMT_YUV420P9 : c->lumToYV12 = (void*)RENAME(yuv9ToY ); break;
- case PIX_FMT_YUV422P10:
- case PIX_FMT_YUV420P10: c->lumToYV12 = (void*)RENAME(yuv10ToY); break;
+ case PIX_FMT_YUV420P9BE: c->lumToYV12 = BE9ToY_c; break;
+ case PIX_FMT_YUV420P9LE: c->lumToYV12 = LE9ToY_c; break;
+ case PIX_FMT_YUV422P10BE:
+ case PIX_FMT_YUV420P10BE: c->lumToYV12 = BE10ToY_c; break;
+ case PIX_FMT_YUV422P10LE:
+ case PIX_FMT_YUV420P10LE: c->lumToYV12 = LE10ToY_c; break;
case PIX_FMT_YUYV422 :
case PIX_FMT_YUV420P16BE:
case PIX_FMT_YUV422P16BE:
diff --git a/libswscale/utils.c b/libswscale/utils.c
index 2c6269487a..ea44190ace 100644
--- a/libswscale/utils.c
+++ b/libswscale/utils.c
@@ -107,15 +107,17 @@ const char *swscale_license(void)
|| (x)==PIX_FMT_YUV440P \
|| (x)==PIX_FMT_MONOWHITE \
|| (x)==PIX_FMT_MONOBLACK \
+ || (x)==PIX_FMT_YUV420P9LE \
+ || (x)==PIX_FMT_YUV420P10LE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
+ || (x)==PIX_FMT_YUV420P9BE \
+ || (x)==PIX_FMT_YUV420P10BE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
- || (x)==PIX_FMT_YUV420P9 \
- || (x)==PIX_FMT_YUV420P10 \
- || (x)==PIX_FMT_YUV422P10 \
+ || (x)==PIX_FMT_YUV422P10 \
)
int sws_isSupportedInput(enum PixelFormat pix_fmt)
@@ -143,12 +145,14 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt)
|| (x)==PIX_FMT_GRAY8 \
|| (x)==PIX_FMT_YUV410P \
|| (x)==PIX_FMT_YUV440P \
- || (x)==PIX_FMT_YUV420P9 \
- || (x)==PIX_FMT_YUV420P10 \
|| (x)==PIX_FMT_YUV422P10 \
+ || (x)==PIX_FMT_YUV420P9LE \
+ || (x)==PIX_FMT_YUV420P10LE \
|| (x)==PIX_FMT_YUV420P16LE \
|| (x)==PIX_FMT_YUV422P16LE \
|| (x)==PIX_FMT_YUV444P16LE \
+ || (x)==PIX_FMT_YUV420P9BE \
+ || (x)==PIX_FMT_YUV420P10BE \
|| (x)==PIX_FMT_YUV420P16BE \
|| (x)==PIX_FMT_YUV422P16BE \
|| (x)==PIX_FMT_YUV444P16BE \
diff --git a/tests/fate/h264.mak b/tests/fate/h264.mak
index 3283c4e0ef..0f18be4888 100644
--- a/tests/fate/h264.mak
+++ b/tests/fate/h264.mak
@@ -307,12 +307,12 @@ fate-h264-conformance-frext-hpcvfl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-co
fate-h264-conformance-frext-hpcvflnl_bcrm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0
fate-h264-conformance-frext-hpcvmolq_brcm_b: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264
fate-h264-conformance-frext-hpcvnl_brcm_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264
-fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p16be
-fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p16be
-fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p16be
-fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p16be
-fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p16be
-fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p16be
+fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p10le
+fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p10le
+fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p10le
+fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p10le
+fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p10le
+fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p10le
fate-h264-conformance-hcbp2_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCBP2_HHI_A.264
fate-h264-conformance-hcmp1_hhi_a: CMD = framecrc -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCMP1_HHI_A.264
fate-h264-conformance-ls_sva_d: CMD = framecrc -i $(SAMPLES)/h264-conformance/LS_SVA_D.264
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a
index d25653dce7..1cfc313e32 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i1_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 2764800, 0xf69f33f5
-0, 3600, 2764800, 0x8d602e2f
-0, 7200, 2764800, 0xe2111955
-0, 10800, 2764800, 0xbbe76d10
-0, 14400, 2764800, 0x81cbbb10
-0, 18000, 2764800, 0xb5259536
-0, 21600, 2764800, 0x4972ded4
-0, 25200, 2764800, 0xc726c878
-0, 28800, 2764800, 0xd8a2b4fc
-0, 32400, 2764800, 0xaa4b80f7
+0, 0, 2764800, 0xcc4df07d
+0, 3600, 2764800, 0x85f9e6d4
+0, 7200, 2764800, 0x23ffe90d
+0, 10800, 2764800, 0xf0a6d453
+0, 14400, 2764800, 0x913a6392
+0, 18000, 2764800, 0xcc5f9736
+0, 21600, 2764800, 0x43f9f9ce
+0, 25200, 2764800, 0xc874b44e
+0, 28800, 2764800, 0x83b665e6
+0, 32400, 2764800, 0x5ea2e31e
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a
index 04d044a28d..274bdaf2b1 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i2_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 2764800, 0x8c3e963e
-0, 3600, 2764800, 0xa1b0f891
-0, 7200, 2764800, 0xcd090f45
-0, 10800, 2764800, 0x2df70987
-0, 14400, 2764800, 0x66d22478
-0, 18000, 2764800, 0x64b0ddef
-0, 21600, 2764800, 0xdd86fb62
-0, 25200, 2764800, 0x36fc36d4
-0, 28800, 2764800, 0xee32176f
-0, 32400, 2764800, 0x99c649b5
+0, 0, 2764800, 0x4f710132
+0, 3600, 2764800, 0x57e5b713
+0, 7200, 2764800, 0xcca01477
+0, 10800, 2764800, 0xa19a95cd
+0, 14400, 2764800, 0x700a757d
+0, 18000, 2764800, 0xd8c6f60f
+0, 21600, 2764800, 0x95a1bbc7
+0, 25200, 2764800, 0x0582077a
+0, 28800, 2764800, 0x91595f91
+0, 32400, 2764800, 0xf5fe034a
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a
index 9290354652..195e45a67b 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i3_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 2764800, 0xe4289a64
-0, 3600, 2764800, 0x01ea4677
-0, 7200, 2764800, 0x7c1b00f4
-0, 10800, 2764800, 0xf51a4695
-0, 14400, 2764800, 0xe1dd8ace
-0, 18000, 2764800, 0xe9fd1996
-0, 21600, 2764800, 0x083ce1db
-0, 25200, 2764800, 0x2c5bc489
-0, 28800, 2764800, 0xb6d10e63
-0, 32400, 2764800, 0x813daf47
+0, 0, 2764800, 0xda69f69e
+0, 3600, 2764800, 0x29ed832f
+0, 7200, 2764800, 0xb3244cc4
+0, 10800, 2764800, 0xe41a312c
+0, 14400, 2764800, 0xac0b344b
+0, 18000, 2764800, 0xc585aa20
+0, 21600, 2764800, 0x0952054c
+0, 25200, 2764800, 0xd1a02f87
+0, 28800, 2764800, 0xfcbfe87c
+0, 32400, 2764800, 0xe4e9b8a2
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
index 646c0da4fb..d351a7eb1f 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i4_panasonic_a
@@ -1,19 +1,19 @@
-0, 0, 6220800, 0x26bc0f20
-0, 3600, 6220800, 0x69acba0c
-0, 7200, 6220800, 0x10d17202
-0, 10800, 6220800, 0x790d98f1
-0, 14400, 6220800, 0x71fe35c2
-0, 18000, 6220800, 0xc9d345cb
-0, 21600, 6220800, 0xcb4bad2e
-0, 25200, 6220800, 0x01604385
-0, 28800, 6220800, 0xe585bb5f
-0, 32400, 6220800, 0xc9d345cb
-0, 36000, 6220800, 0x2bdf0dd0
-0, 39600, 6220800, 0x79794ac4
-0, 43200, 6220800, 0x106afcdf
-0, 46800, 6220800, 0xc9d345cb
-0, 50400, 6220800, 0x106afcdf
-0, 54000, 6220800, 0xc9d345cb
-0, 57600, 6220800, 0x106afcdf
-0, 61200, 6220800, 0xc9d345cb
-0, 64800, 6220800, 0xf0b8dde0
+0, 0, 6220800, 0xca2a2a5e
+0, 3600, 6220800, 0x8009a65e
+0, 7200, 6220800, 0x63e72b3b
+0, 10800, 6220800, 0x7459a1cc
+0, 14400, 6220800, 0x02191aa9
+0, 18000, 6220800, 0x88dca590
+0, 21600, 6220800, 0x56dd150a
+0, 25200, 6220800, 0x5f56a56f
+0, 28800, 6220800, 0x67ada4b7
+0, 32400, 6220800, 0x88dca590
+0, 36000, 6220800, 0xd3b09fe5
+0, 39600, 6220800, 0x2223998c
+0, 43200, 6220800, 0x5e5b2da5
+0, 46800, 6220800, 0x88dca590
+0, 50400, 6220800, 0x5e5b2da5
+0, 54000, 6220800, 0x88dca590
+0, 57600, 6220800, 0x5e5b2da5
+0, 61200, 6220800, 0x88dca590
+0, 64800, 6220800, 0x26e1ec8b
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a
index 042825e8b8..1afbac01e7 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i5_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 6220800, 0x77a0ee6a
-0, 3600, 6220800, 0x1850d87c
-0, 7200, 6220800, 0x116ac02c
-0, 10800, 6220800, 0xb834fb9d
-0, 14400, 6220800, 0xabfae062
-0, 18000, 6220800, 0x717845a7
-0, 21600, 6220800, 0xb246fc4b
-0, 25200, 6220800, 0x2cf2769d
-0, 28800, 6220800, 0xf8ac6a4a
-0, 32400, 6220800, 0xfa278467
+0, 0, 6220800, 0x1df58ce9
+0, 3600, 6220800, 0x8f2859ce
+0, 7200, 6220800, 0x229cc7ff
+0, 10800, 6220800, 0x73e86984
+0, 14400, 6220800, 0xb6d4504b
+0, 18000, 6220800, 0x4e7d4883
+0, 21600, 6220800, 0xbec3f0f7
+0, 25200, 6220800, 0x1d9af065
+0, 28800, 6220800, 0x44851549
+0, 32400, 6220800, 0xfcf8728e
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a
index 1b1dce984e..6d105466c9 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i6_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 6220800, 0x738b0778
-0, 3600, 6220800, 0x04821310
-0, 7200, 6220800, 0x4837f3d9
-0, 10800, 6220800, 0x5e246bfe
-0, 14400, 6220800, 0xdb46d88c
-0, 18000, 6220800, 0x74b67352
-0, 21600, 6220800, 0x1cdb5be8
-0, 25200, 6220800, 0x2d5e5f1e
-0, 28800, 6220800, 0x429c5928
-0, 32400, 6220800, 0x8e227f6c
+0, 0, 6220800, 0x408daf70
+0, 3600, 6220800, 0x59b254a3
+0, 7200, 6220800, 0x4cf4279c
+0, 10800, 6220800, 0x5c9437ae
+0, 14400, 6220800, 0x986c3eb8
+0, 18000, 6220800, 0x23fd883e
+0, 21600, 6220800, 0x84f222fe
+0, 25200, 6220800, 0xe7f91107
+0, 28800, 6220800, 0xb544b31e
+0, 32400, 6220800, 0x1ebdde56
diff --git a/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a b/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a
index 0ca78c155f..28825446f9 100644
--- a/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a
+++ b/tests/ref/fate/h264-conformance-frext-pph10i7_panasonic_a
@@ -1,10 +1,10 @@
-0, 0, 6220800, 0x6616177e
-0, 3600, 6220800, 0xf3fe7a1c
-0, 7200, 6220800, 0x44f0fab6
-0, 10800, 6220800, 0x109ff851
-0, 14400, 6220800, 0x9501f055
-0, 18000, 6220800, 0x603d6e3d
-0, 21600, 6220800, 0x42126cfb
-0, 25200, 6220800, 0x113169e8
-0, 28800, 6220800, 0xe8f64949
-0, 32400, 6220800, 0x89488caf
+0, 0, 6220800, 0xf81873fe
+0, 3600, 6220800, 0x7b96fbdc
+0, 7200, 6220800, 0x75dbafc4
+0, 10800, 6220800, 0x7524301e
+0, 14400, 6220800, 0x0f3621ab
+0, 18000, 6220800, 0xa5e25b35
+0, 21600, 6220800, 0x063a8116
+0, 25200, 6220800, 0x48ebc8ff
+0, 28800, 6220800, 0x1f635df8
+0, 32400, 6220800, 0xe282c8bd
diff --git a/tests/ref/lavfi/pixdesc_le b/tests/ref/lavfi/pixdesc_le
index a6cd618b72..a96635d508 100644
--- a/tests/ref/lavfi/pixdesc_le
+++ b/tests/ref/lavfi/pixdesc_le
@@ -27,9 +27,11 @@ uyvy422 adcf64516a19fce44df77082bdb16291
yuv410p 2d9225153c83ee1132397d619d94d1b3
yuv411p 8b298af3e43348ca1b11eb8a3252ac6c
yuv420p eba2f135a08829387e2f698ff72a2939
+yuv420p10be 7605e266c088d0fcf68c7b27c3ceff5f
yuv420p10le 4228ee628c6deec123a13b9784516cc7
yuv420p16be 16c009a235cd52b74791a895423152a3
yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc
+yuv420p9be ce880fa07830e5297c22acf6e20555ce
yuv420p9le 16543fda8f87d94a6cf857d2e8d4461a
yuv422p c9bba4529821d796a6ab09f6a5fd355a
yuv422p10le d0607c260a45c973e6639f4e449730ad
diff --git a/tests/ref/lavfi/pixfmts_copy_le b/tests/ref/lavfi/pixfmts_copy_le
index a6cd618b72..a96635d508 100644
--- a/tests/ref/lavfi/pixfmts_copy_le
+++ b/tests/ref/lavfi/pixfmts_copy_le
@@ -27,9 +27,11 @@ uyvy422 adcf64516a19fce44df77082bdb16291
yuv410p 2d9225153c83ee1132397d619d94d1b3
yuv411p 8b298af3e43348ca1b11eb8a3252ac6c
yuv420p eba2f135a08829387e2f698ff72a2939
+yuv420p10be 7605e266c088d0fcf68c7b27c3ceff5f
yuv420p10le 4228ee628c6deec123a13b9784516cc7
yuv420p16be 16c009a235cd52b74791a895423152a3
yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc
+yuv420p9be ce880fa07830e5297c22acf6e20555ce
yuv420p9le 16543fda8f87d94a6cf857d2e8d4461a
yuv422p c9bba4529821d796a6ab09f6a5fd355a
yuv422p10le d0607c260a45c973e6639f4e449730ad
diff --git a/tests/ref/lavfi/pixfmts_null_le b/tests/ref/lavfi/pixfmts_null_le
index a6cd618b72..a96635d508 100644
--- a/tests/ref/lavfi/pixfmts_null_le
+++ b/tests/ref/lavfi/pixfmts_null_le
@@ -27,9 +27,11 @@ uyvy422 adcf64516a19fce44df77082bdb16291
yuv410p 2d9225153c83ee1132397d619d94d1b3
yuv411p 8b298af3e43348ca1b11eb8a3252ac6c
yuv420p eba2f135a08829387e2f698ff72a2939
+yuv420p10be 7605e266c088d0fcf68c7b27c3ceff5f
yuv420p10le 4228ee628c6deec123a13b9784516cc7
yuv420p16be 16c009a235cd52b74791a895423152a3
yuv420p16le 2d59c4f1d0314a5a957a7cfc4b6fabcc
+yuv420p9be ce880fa07830e5297c22acf6e20555ce
yuv420p9le 16543fda8f87d94a6cf857d2e8d4461a
yuv422p c9bba4529821d796a6ab09f6a5fd355a
yuv422p10le d0607c260a45c973e6639f4e449730ad
diff --git a/tests/ref/lavfi/pixfmts_scale_le b/tests/ref/lavfi/pixfmts_scale_le
index c965b60c2b..5c32a363c8 100644
--- a/tests/ref/lavfi/pixfmts_scale_le
+++ b/tests/ref/lavfi/pixfmts_scale_le
@@ -27,9 +27,11 @@ uyvy422 314bd486277111a95d9369b944fa0400
yuv410p 7df8f6d69b56a8dcb6c7ee908e5018b5
yuv411p 1143e7c5cc28fe0922b051b17733bc4c
yuv420p fdad2d8df8985e3d17e73c71f713cb14
+yuv420p10be 6d335e75b553da590135cf8bb999610c
yuv420p10le d510ddbabefd03ef39ec943fcb51b709
yuv420p16be 29a0265764530070f5cd3251cc01f66a
yuv420p16le 6f3a265b084a78baec229238d9f7945f
+yuv420p9be ec4983b7a949c0472110a7a2c58e278a
yuv420p9le c136dce5913a722eee44ab72cff664b2
yuv422p 918e37701ee7377d16a8a6c119c56a40
yuv422p10le aeb0ef08a883f43429ca9d886d8fc095
diff --git a/tests/ref/lavfi/pixfmts_vflip_le b/tests/ref/lavfi/pixfmts_vflip_le
index ec6b6c2751..3029d2d550 100644
--- a/tests/ref/lavfi/pixfmts_vflip_le
+++ b/tests/ref/lavfi/pixfmts_vflip_le
@@ -27,9 +27,11 @@ uyvy422 ffbd36720c77398d9a0d03ce2625928f
yuv410p 7bfb39d7afb49d6a6173e6b23ae321eb
yuv411p 4a90048cc3a65fac150e53289700efe1
yuv420p 2e6d6062e8cad37fb3ab2c433b55f382
+yuv420p10be df97d20b3b4a10c174d4360552c4160d
yuv420p10le 4b5249208602b941332945c926f80ae9
yuv420p16be 539076782902664a8acf381bf4f713e8
yuv420p16le 0f609e588e5a258644ef85170d70e030
+yuv420p9be be40ec975fb2873891643cbbbddbc3b0
yuv420p9le 7e606310d3f5ff12badf911e8f333471
yuv422p d7f5cb44d9b0210d66d6a8762640ab34
yuv422p10le 11b57f2bd9661024153f3973b9090cdb