Browse code

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>

Michael Niedermayer authored on 2011/05/13 11:40:40
Showing 47 changed files
... ...
@@ -88,7 +88,7 @@ Configuration options:
88 88
   --disable-avcodec        disable libavcodec build
89 89
   --disable-avformat       disable libavformat build
90 90
   --disable-swscale        disable libswscale build
91
-  --enable-postproc        enable GPLed postprocessing support [no]
91
+  --disable-postproc       disable libpostproc build
92 92
   --disable-avfilter       disable video filter support [no]
93 93
   --disable-pthreads       disable pthreads [auto]
94 94
   --enable-w32threads      use Win32 threads [no]
... ...
@@ -1497,6 +1497,7 @@ yadif_filter_deps="gpl"
1497 1497
 # libraries
1498 1498
 avdevice_deps="avcodec avformat"
1499 1499
 avformat_deps="avcodec"
1500
+postproc_deps="gpl"
1500 1501
 
1501 1502
 # programs
1502 1503
 ffmpeg_deps="avcodec avformat swscale"
... ...
@@ -1667,6 +1668,7 @@ enable ffprobe
1667 1667
 enable ffserver
1668 1668
 enable network
1669 1669
 enable optimizations
1670
+enable postproc
1670 1671
 enable protocols
1671 1672
 enable static
1672 1673
 enable stripping
... ...
@@ -1689,7 +1691,7 @@ LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
1689 1689
 
1690 1690
 CC_O='-o $@'
1691 1691
 
1692
-host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall'
1692
+host_cflags='-D_ISOC99_SOURCE -O3 -g -Wall'
1693 1693
 host_libs='-lm'
1694 1694
 
1695 1695
 target_path='$(CURDIR)'
... ...
@@ -2342,7 +2344,7 @@ if test "$?" != 0; then
2342 2342
     die "C compiler test failed."
2343 2343
 fi
2344 2344
 
2345
-add_cppflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
2345
+add_cppflags -D_ISOC99_SOURCE
2346 2346
 check_cflags -std=c99
2347 2347
 check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
2348 2348
 #include <stdlib.h>
... ...
@@ -2390,7 +2392,6 @@ case $target_os in
2390 2390
         disable symver
2391 2391
         oss_indev_extralibs="-lossaudio"
2392 2392
         oss_outdev_extralibs="-lossaudio"
2393
-        add_cppflags -D_XOPEN_SOURCE=600
2394 2393
         ;;
2395 2394
     openbsd)
2396 2395
         enable malloc_aligned
... ...
@@ -2484,6 +2485,7 @@ case $target_os in
2484 2484
         enable dos_paths
2485 2485
         ;;
2486 2486
     linux)
2487
+        add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
2487 2488
         enable dv1394
2488 2489
         ;;
2489 2490
     irix*)
... ...
@@ -2559,7 +2561,6 @@ die_license_disabled() {
2559 2559
 die_license_disabled gpl libx264
2560 2560
 die_license_disabled gpl libxavs
2561 2561
 die_license_disabled gpl libxvid
2562
-die_license_disabled gpl postproc
2563 2562
 die_license_disabled gpl x11grab
2564 2563
 
2565 2564
 die_license_disabled nonfree libfaac
... ...
@@ -19,9 +19,6 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-/* needed for usleep() */
23
-#define _XOPEN_SOURCE 600
24
-
25 22
 #include "config.h"
26 23
 #include <ctype.h>
27 24
 #include <string.h>
... ...
@@ -1404,11 +1401,11 @@ static void print_report(AVFormatContext **output_files,
1404 1404
     ti1 = 1e10;
1405 1405
     vid = 0;
1406 1406
     for(i=0;i<nb_ostreams;i++) {
1407
-        float q= -1;
1407
+        float q = -1;
1408 1408
         ost = ost_table[i];
1409 1409
         enc = ost->st->codec;
1410
-        if(!ost->st->stream_copy && enc->coded_frame)
1411
-            q= enc->coded_frame->quality/(float)FF_QP2LAMBDA;
1410
+        if (!ost->st->stream_copy && enc->coded_frame)
1411
+            q = enc->coded_frame->quality/(float)FF_QP2LAMBDA;
1412 1412
         if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1413 1413
             snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", q);
1414 1414
         }
... ...
@@ -1422,7 +1419,7 @@ static void print_report(AVFormatContext **output_files,
1422 1422
                 snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "L");
1423 1423
             if(qp_hist){
1424 1424
                 int j;
1425
-                int qp= lrintf(q);
1425
+                int qp = lrintf(q);
1426 1426
                 if(qp>=0 && qp<FF_ARRAY_ELEMS(qp_histogram))
1427 1427
                     qp_histogram[qp]++;
1428 1428
                 for(j=0; j<32; j++)
... ...
@@ -19,8 +19,6 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#define _XOPEN_SOURCE 600
23
-
24 22
 #include "config.h"
25 23
 #include <inttypes.h>
26 24
 #include <math.h>
... ...
@@ -19,8 +19,6 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-#define _XOPEN_SOURCE 600
23
-
24 22
 #include "config.h"
25 23
 #if !HAVE_CLOSESOCKET
26 24
 #define closesocket close
... ...
@@ -791,35 +791,53 @@ static void count_frame_bits_fixed(AC3EncodeContext *s)
791 791
      *   no auxilliary data
792 792
      */
793 793
 
794
-    /* header size */
794
+    /* header */
795 795
     frame_bits = 65;
796 796
     frame_bits += frame_bits_inc[s->channel_mode];
797 797
 
798 798
     /* audio blocks */
799 799
     for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
800
-        frame_bits += s->fbw_channels * 2 + 2; /* blksw * c, dithflag * c, dynrnge, cplstre */
801
-        if (s->channel_mode == AC3_CHMODE_STEREO) {
802
-            frame_bits++; /* rematstr */
803
-        }
804
-        frame_bits += 2 * s->fbw_channels; /* chexpstr[2] * c */
800
+        /* block switch flags */
801
+        frame_bits += s->fbw_channels;
802
+
803
+        /* dither flags */
804
+        frame_bits += s->fbw_channels;
805
+
806
+        /* dynamic range */
807
+        frame_bits++;
808
+
809
+        /* coupling strategy */
810
+        frame_bits++;
811
+        if (!blk)
812
+            frame_bits++;
813
+
814
+        /* exponent strategy */
815
+        frame_bits += 2 * s->fbw_channels;
805 816
         if (s->lfe_on)
806
-            frame_bits++; /* lfeexpstr */
807
-        frame_bits++; /* baie */
808
-        frame_bits++; /* snr */
809
-        frame_bits += 2; /* delta / skip */
817
+            frame_bits++;
818
+
819
+        /* bit allocation params */
820
+        frame_bits++;
821
+        if (!blk)
822
+            frame_bits += 2 + 2 + 2 + 2 + 3;
823
+
824
+        /* snr offsets and fast gain codes */
825
+        frame_bits++;
826
+        if (!blk)
827
+            frame_bits += 6 + s->channels * (4 + 3);
828
+
829
+        /* delta bit allocation */
830
+        frame_bits++;
831
+
832
+        /* skipped data */
833
+        frame_bits++;
810 834
     }
811
-    frame_bits++; /* cplinu for block 0 */
812
-    /* bit alloc info */
813
-    /* sdcycod[2], fdcycod[2], sgaincod[2], dbpbcod[2], floorcod[3] */
814
-    /* csnroffset[6] */
815
-    /* (fsnoffset[4] + fgaincod[4]) * c */
816
-    frame_bits += 2*4 + 3 + 6 + s->channels * (4 + 3);
817 835
 
818
-    /* auxdatae, crcrsv */
819
-    frame_bits += 2;
836
+    /* auxiliary data */
837
+    frame_bits++;
820 838
 
821 839
     /* CRC */
822
-    frame_bits += 16;
840
+    frame_bits += 1 + 16;
823 841
 
824 842
     s->frame_bits_fixed = frame_bits;
825 843
 }
... ...
@@ -869,6 +887,7 @@ static void count_frame_bits(AC3EncodeContext *s)
869 869
     int blk, ch;
870 870
     int frame_bits = 0;
871 871
 
872
+    /* header */
872 873
     if (opt->audio_production_info)
873 874
         frame_bits += 7;
874 875
     if (s->bitstream_id == 6) {
... ...
@@ -878,18 +897,22 @@ static void count_frame_bits(AC3EncodeContext *s)
878 878
             frame_bits += 14;
879 879
     }
880 880
 
881
+    /* audio blocks */
881 882
     for (blk = 0; blk < AC3_MAX_BLOCKS; blk++) {
882 883
         /* stereo rematrixing */
883
-        if (s->channel_mode == AC3_CHMODE_STEREO &&
884
-            s->blocks[blk].new_rematrixing_strategy) {
885
-            frame_bits += s->num_rematrixing_bands;
884
+        if (s->channel_mode == AC3_CHMODE_STEREO) {
885
+            frame_bits++;
886
+            if (s->blocks[blk].new_rematrixing_strategy)
887
+                frame_bits += s->num_rematrixing_bands;
886 888
         }
887 889
 
890
+        /* bandwidth codes & gain range */
888 891
         for (ch = 0; ch < s->fbw_channels; ch++) {
889 892
             if (s->exp_strategy[ch][blk] != EXP_REUSE)
890
-                frame_bits += 6 + 2; /* chbwcod[6], gainrng[2] */
893
+                frame_bits += 6 + 2;
891 894
         }
892 895
     }
896
+
893 897
     s->frame_bits = s->frame_bits_fixed + frame_bits;
894 898
 }
895 899
 
... ...
@@ -233,15 +233,16 @@ extern const struct dec_2dvlc ff_cavs_chroma_dec[5];
233 233
 extern const uint8_t     ff_cavs_chroma_qp[64];
234 234
 extern const uint8_t     ff_cavs_scan3x3[4];
235 235
 extern const uint8_t     ff_cavs_partition_flags[30];
236
-extern const int_fast8_t ff_left_modifier_l[8];
237
-extern const int_fast8_t ff_top_modifier_l[8];
238
-extern const int_fast8_t ff_left_modifier_c[7];
239
-extern const int_fast8_t ff_top_modifier_c[7];
236
+extern const int8_t      ff_left_modifier_l[8];
237
+extern const int8_t      ff_top_modifier_l[8];
238
+extern const int8_t      ff_left_modifier_c[7];
239
+extern const int8_t      ff_top_modifier_c[7];
240 240
 extern const cavs_vector ff_cavs_intra_mv;
241 241
 extern const cavs_vector ff_cavs_un_mv;
242 242
 extern const cavs_vector ff_cavs_dir_mv;
243 243
 
244
-static inline void modify_pred(const int_fast8_t *mod_table, int *mode) {
244
+static inline void modify_pred(const int8_t *mod_table, int *mode)
245
+{
245 246
     *mode = mod_table[*mode];
246 247
     if(*mode < 0) {
247 248
         av_log(NULL, AV_LOG_ERROR, "Illegal intra prediction mode\n");
... ...
@@ -497,9 +497,9 @@ static const uint8_t tc_tab[64] = {
497 497
   5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9
498 498
 };
499 499
 
500
-const int_fast8_t ff_left_modifier_l[8] = { 0,-1, 6,-1,-1, 7, 6, 7};
501
-const int_fast8_t ff_top_modifier_l[8]  = {-1, 1, 5,-1,-1, 5, 7, 7};
502
-const int_fast8_t ff_left_modifier_c[7] = { 5,-1, 2,-1, 6, 5, 6};
503
-const int_fast8_t ff_top_modifier_c[7]  = { 4, 1,-1,-1, 4, 6, 6};
500
+const int8_t ff_left_modifier_l[8] = {  0, -1,  6, -1, -1, 7, 6, 7 };
501
+const int8_t ff_top_modifier_l[8]  = { -1,  1,  5, -1, -1, 5, 7, 7 };
502
+const int8_t ff_left_modifier_c[7] = {  5, -1,  2, -1,  6, 5, 6 };
503
+const int8_t ff_top_modifier_c[7]  = {  4,  1, -1, -1,  4, 6, 6 };
504 504
 
505 505
 #endif /* AVCODEC_CAVSDATA_H */
... ...
@@ -250,7 +250,7 @@ typedef struct FFV1Context{
250 250
     uint8_t (*initial_states[MAX_QUANT_TABLES])[32];
251 251
     int run_index;
252 252
     int colorspace;
253
-    int_fast16_t *sample_buffer;
253
+    int16_t *sample_buffer;
254 254
     int gob_count;
255 255
     int packed_at_lsb;
256 256
 
... ...
@@ -280,7 +280,8 @@ static av_always_inline int fold(int diff, int bits){
280 280
     return diff;
281 281
 }
282 282
 
283
-static inline int predict(int_fast16_t *src, int_fast16_t *last){
283
+static inline int predict(int16_t *src, int16_t *last)
284
+{
284 285
     const int LT= last[-1];
285 286
     const int  T= last[ 0];
286 287
     const int L =  src[-1];
... ...
@@ -288,7 +289,9 @@ static inline int predict(int_fast16_t *src, int_fast16_t *last){
288 288
     return mid_pred(L, L + T - LT, T);
289 289
 }
290 290
 
291
-static inline int get_context(PlaneContext *p, int_fast16_t *src, int_fast16_t *last, int_fast16_t *last2){
291
+static inline int get_context(PlaneContext *p, int16_t *src,
292
+                              int16_t *last, int16_t *last2)
293
+{
292 294
     const int LT= last[-1];
293 295
     const int  T= last[ 0];
294 296
     const int RT= last[ 1];
... ...
@@ -507,7 +510,10 @@ static inline int get_vlc_symbol(GetBitContext *gb, VlcState * const state, int
507 507
 }
508 508
 
509 509
 #if CONFIG_FFV1_ENCODER
510
-static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
510
+static av_always_inline int encode_line(FFV1Context *s, int w,
511
+                                        int16_t *sample[2],
512
+                                        int plane_index, int bits)
513
+{
511 514
     PlaneContext * const p= &s->plane[plane_index];
512 515
     RangeCoder * const c= &s->c;
513 516
     int x;
... ...
@@ -592,7 +598,7 @@ static av_always_inline int encode_line(FFV1Context *s, int w, int_fast16_t *sam
592 592
 static void encode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
593 593
     int x,y,i;
594 594
     const int ring_size= s->avctx->context_model ? 3 : 2;
595
-    int_fast16_t *sample[3];
595
+    int16_t *sample[3];
596 596
     s->run_index=0;
597 597
 
598 598
     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,
628 628
 static void encode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
629 629
     int x, y, p, i;
630 630
     const int ring_size= s->avctx->context_model ? 3 : 2;
631
-    int_fast16_t *sample[3][3];
631
+    int16_t *sample[3][3];
632 632
     s->run_index=0;
633 633
 
634 634
     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){
1318 1318
     return 0;
1319 1319
 }
1320 1320
 
1321
-static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sample[2], int plane_index, int bits){
1321
+static av_always_inline void decode_line(FFV1Context *s, int w,
1322
+                                         int16_t *sample[2],
1323
+                                         int plane_index, int bits)
1324
+{
1322 1325
     PlaneContext * const p= &s->plane[plane_index];
1323 1326
     RangeCoder * const c= &s->c;
1324 1327
     int x;
... ...
@@ -1378,7 +1387,7 @@ static av_always_inline void decode_line(FFV1Context *s, int w, int_fast16_t *sa
1378 1378
 
1379 1379
 static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride, int plane_index){
1380 1380
     int x, y;
1381
-    int_fast16_t *sample[2];
1381
+    int16_t *sample[2];
1382 1382
     sample[0]=s->sample_buffer    +3;
1383 1383
     sample[1]=s->sample_buffer+w+6+3;
1384 1384
 
... ...
@@ -1387,7 +1396,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
1387 1387
     memset(s->sample_buffer, 0, 2*(w+6)*sizeof(*s->sample_buffer));
1388 1388
 
1389 1389
     for(y=0; y<h; y++){
1390
-        int_fast16_t *temp= sample[0]; //FIXME try a normal buffer
1390
+        int16_t *temp = sample[0]; //FIXME try a normal buffer
1391 1391
 
1392 1392
         sample[0]= sample[1];
1393 1393
         sample[1]= temp;
... ...
@@ -1419,7 +1428,7 @@ static void decode_plane(FFV1Context *s, uint8_t *src, int w, int h, int stride,
1419 1419
 
1420 1420
 static void decode_rgb_frame(FFV1Context *s, uint32_t *src, int w, int h, int stride){
1421 1421
     int x, y, p;
1422
-    int_fast16_t *sample[3][2];
1422
+    int16_t *sample[3][2];
1423 1423
     for(x=0; x<3; x++){
1424 1424
         sample[x][0] = s->sample_buffer +  x*2   *(w+6) + 3;
1425 1425
         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
1431 1431
 
1432 1432
     for(y=0; y<h; y++){
1433 1433
         for(p=0; p<3; p++){
1434
-            int_fast16_t *temp= sample[p][0]; //FIXME try a normal buffer
1434
+            int16_t *temp = sample[p][0]; //FIXME try a normal buffer
1435 1435
 
1436 1436
             sample[p][0]= sample[p][1];
1437 1437
             sample[p][1]= temp;
... ...
@@ -145,9 +145,9 @@
145 145
 #define MULTIPLY(var,const)  ((DCTELEM) DESCALE((var) * (const), CONST_BITS))
146 146
 
147 147
 static av_always_inline void row_fdct(DCTELEM * data){
148
-  int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
149
-  int_fast16_t tmp10, tmp11, tmp12, tmp13;
150
-  int_fast16_t z1, z2, z3, z4, z5, z11, z13;
148
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
149
+  int tmp10, tmp11, tmp12, tmp13;
150
+  int z1, z2, z3, z4, z5, z11, z13;
151 151
   DCTELEM *dataptr;
152 152
   int ctr;
153 153
 
... ...
@@ -209,9 +209,9 @@ static av_always_inline void row_fdct(DCTELEM * data){
209 209
 GLOBAL(void)
210 210
 fdct_ifast (DCTELEM * data)
211 211
 {
212
-  int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
213
-  int_fast16_t tmp10, tmp11, tmp12, tmp13;
214
-  int_fast16_t z1, z2, z3, z4, z5, z11, z13;
212
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
213
+  int tmp10, tmp11, tmp12, tmp13;
214
+  int z1, z2, z3, z4, z5, z11, z13;
215 215
   DCTELEM *dataptr;
216 216
   int ctr;
217 217
 
... ...
@@ -275,9 +275,9 @@ fdct_ifast (DCTELEM * data)
275 275
 GLOBAL(void)
276 276
 fdct_ifast248 (DCTELEM * data)
277 277
 {
278
-  int_fast16_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
279
-  int_fast16_t tmp10, tmp11, tmp12, tmp13;
280
-  int_fast16_t z1;
278
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
279
+  int tmp10, tmp11, tmp12, tmp13;
280
+  int z1;
281 281
   DCTELEM *dataptr;
282 282
   int ctr;
283 283
 
... ...
@@ -181,9 +181,9 @@
181 181
 
182 182
 
183 183
 static av_always_inline void row_fdct(DCTELEM * data){
184
-  int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
185
-  int_fast32_t tmp10, tmp11, tmp12, tmp13;
186
-  int_fast32_t z1, z2, z3, z4, z5;
184
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
185
+  int tmp10, tmp11, tmp12, tmp13;
186
+  int z1, z2, z3, z4, z5;
187 187
   DCTELEM *dataptr;
188 188
   int ctr;
189 189
 
... ...
@@ -259,9 +259,9 @@ static av_always_inline void row_fdct(DCTELEM * data){
259 259
 GLOBAL(void)
260 260
 ff_jpeg_fdct_islow (DCTELEM * data)
261 261
 {
262
-  int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
263
-  int_fast32_t tmp10, tmp11, tmp12, tmp13;
264
-  int_fast32_t z1, z2, z3, z4, z5;
262
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
263
+  int tmp10, tmp11, tmp12, tmp13;
264
+  int z1, z2, z3, z4, z5;
265 265
   DCTELEM *dataptr;
266 266
   int ctr;
267 267
 
... ...
@@ -345,9 +345,9 @@ ff_jpeg_fdct_islow (DCTELEM * data)
345 345
 GLOBAL(void)
346 346
 ff_fdct248_islow (DCTELEM * data)
347 347
 {
348
-  int_fast32_t tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
349
-  int_fast32_t tmp10, tmp11, tmp12, tmp13;
350
-  int_fast32_t z1;
348
+  int tmp0, tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7;
349
+  int tmp10, tmp11, tmp12, tmp13;
350
+  int z1;
351 351
   DCTELEM *dataptr;
352 352
   int ctr;
353 353
 
... ...
@@ -25,9 +25,6 @@
25 25
  * @author Adam Thayer (krevnik@comcast.net)
26 26
  */
27 27
 
28
-/* needed for mkstemp() */
29
-#define _XOPEN_SOURCE 600
30
-
31 28
 #include <xvid.h>
32 29
 #include <unistd.h>
33 30
 #include "avcodec.h"
... ...
@@ -38,7 +38,7 @@ typedef struct TiffContext {
38 38
     AVFrame picture;
39 39
 
40 40
     int width, height;
41
-    unsigned int bpp;
41
+    unsigned int bpp, bppcount;
42 42
     int le;
43 43
     enum TiffCompr compr;
44 44
     int invert;
... ...
@@ -214,6 +214,55 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t* dst, int stride, const uin
214 214
     return 0;
215 215
 }
216 216
 
217
+static int init_image(TiffContext *s)
218
+{
219
+    int i, ret;
220
+    uint32_t *pal;
221
+
222
+    switch (s->bpp * 10 + s->bppcount) {
223
+    case 11:
224
+        s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
225
+        break;
226
+    case 81:
227
+        s->avctx->pix_fmt = PIX_FMT_PAL8;
228
+        break;
229
+    case 243:
230
+        s->avctx->pix_fmt = PIX_FMT_RGB24;
231
+        break;
232
+    case 161:
233
+        s->avctx->pix_fmt = PIX_FMT_GRAY16BE;
234
+        break;
235
+    case 324:
236
+        s->avctx->pix_fmt = PIX_FMT_RGBA;
237
+        break;
238
+    case 483:
239
+        s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;
240
+        break;
241
+    default:
242
+        av_log(s->avctx, AV_LOG_ERROR,
243
+               "This format is not supported (bpp=%d, bppcount=%d)\n",
244
+               s->bpp, s->bppcount);
245
+        return AVERROR_INVALIDDATA;
246
+    }
247
+    if (s->width != s->avctx->width || s->height != s->avctx->height) {
248
+        if ((ret = av_image_check_size(s->width, s->height, 0, s->avctx)) < 0)
249
+            return ret;
250
+        avcodec_set_dimensions(s->avctx, s->width, s->height);
251
+    }
252
+    if (s->picture.data[0])
253
+        s->avctx->release_buffer(s->avctx, &s->picture);
254
+    if ((ret = s->avctx->get_buffer(s->avctx, &s->picture)) < 0) {
255
+        av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
256
+        return ret;
257
+    }
258
+    if (s->bpp == 8 && s->picture.data[1]){
259
+        /* make default grayscale pal */
260
+        pal = (uint32_t *) s->picture.data[1];
261
+        for (i = 0; i < 256; i++)
262
+            pal[i] = i * 0x010101;
263
+    }
264
+    return 0;
265
+}
217 266
 
218 267
 static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *buf, const uint8_t *end_buf)
219 268
 {
... ...
@@ -267,6 +316,7 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
267 267
         s->height = value;
268 268
         break;
269 269
     case TIFF_BPP:
270
+        s->bppcount = count;
270 271
         if(count > 4){
271 272
             av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count);
272 273
             return -1;
... ...
@@ -286,46 +336,16 @@ static int tiff_decode_tag(TiffContext *s, const uint8_t *start, const uint8_t *
286 286
                 s->bpp = -1;
287 287
             }
288 288
         }
289
-        switch(s->bpp*10 + count){
290
-        case 11:
291
-            s->avctx->pix_fmt = PIX_FMT_MONOBLACK;
292
-            break;
293
-        case 81:
294
-            s->avctx->pix_fmt = PIX_FMT_PAL8;
295
-            break;
296
-        case 243:
297
-            s->avctx->pix_fmt = PIX_FMT_RGB24;
298
-            break;
299
-        case 161:
300
-            s->avctx->pix_fmt = PIX_FMT_GRAY16BE;
301
-            break;
302
-        case 324:
303
-            s->avctx->pix_fmt = PIX_FMT_RGBA;
304
-            break;
305
-        case 483:
306
-            s->avctx->pix_fmt = s->le ? PIX_FMT_RGB48LE : PIX_FMT_RGB48BE;
307
-            break;
308
-        default:
309
-            av_log(s->avctx, AV_LOG_ERROR, "This format is not supported (bpp=%d, %d components)\n", s->bpp, count);
310
-            return -1;
311
-        }
312
-        if(s->width != s->avctx->width || s->height != s->avctx->height){
313
-            if(av_image_check_size(s->width, s->height, 0, s->avctx))
314
-                return -1;
315
-            avcodec_set_dimensions(s->avctx, s->width, s->height);
316
-        }
317
-        if(s->picture.data[0])
318
-            s->avctx->release_buffer(s->avctx, &s->picture);
319
-        if(s->avctx->get_buffer(s->avctx, &s->picture) < 0){
320
-            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
321
-            return -1;
322
-        }
323
-        if(s->bpp == 8){
324
-            /* make default grayscale pal */
325
-            pal = (uint32_t *) s->picture.data[1];
326
-            for(i = 0; i < 256; i++)
327
-                pal[i] = i * 0x010101;
328
-        }
289
+        break;
290
+    case TIFF_SAMPLES_PER_PIXEL:
291
+        if (count != 1) {
292
+            av_log(s->avctx, AV_LOG_ERROR,
293
+                   "Samples per pixel requires a single value, many provided\n");
294
+            return AVERROR_INVALIDDATA;
295
+        }
296
+        if (s->bppcount == 1)
297
+            s->bpp *= value;
298
+        s->bppcount = value;
329 299
         break;
330 300
     case TIFF_COMPR:
331 301
         s->compr = value;
... ...
@@ -468,7 +488,7 @@ static int decode_frame(AVCodecContext *avctx,
468 468
     AVFrame *picture = data;
469 469
     AVFrame * const p= (AVFrame*)&s->picture;
470 470
     const uint8_t *orig_buf = buf, *end_buf = buf + buf_size;
471
-    int id, le, off;
471
+    int id, le, off, ret;
472 472
     int i, j, entries;
473 473
     int stride, soff, ssize;
474 474
     uint8_t *dst;
... ...
@@ -509,21 +529,9 @@ static int decode_frame(AVCodecContext *avctx,
509 509
         return -1;
510 510
     }
511 511
     /* now we have the data and may start decoding */
512
-    if(!p->data[0]){
513
-        s->bpp = 1;
514
-        avctx->pix_fmt = PIX_FMT_MONOBLACK;
515
-        if(s->width != s->avctx->width || s->height != s->avctx->height){
516
-            if(av_image_check_size(s->width, s->height, 0, s->avctx))
517
-                return -1;
518
-            avcodec_set_dimensions(s->avctx, s->width, s->height);
519
-        }
520
-        if(s->picture.data[0])
521
-            s->avctx->release_buffer(s->avctx, &s->picture);
522
-        if(s->avctx->get_buffer(s->avctx, &s->picture) < 0){
523
-            av_log(s->avctx, AV_LOG_ERROR, "get_buffer() failed\n");
524
-            return -1;
525
-        }
526
-    }
512
+    if ((ret = init_image(s)) < 0)
513
+        return ret;
514
+
527 515
     if(s->strips == 1 && !s->stripsize){
528 516
         av_log(avctx, AV_LOG_WARNING, "Image data size missing\n");
529 517
         s->stripsize = buf_size - s->stripoff;
... ...
@@ -53,9 +53,7 @@ unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n)
53 53
 // reasonable to check redundantly.
54 54
 int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
55 55
 {
56
-    uint_fast32_t exit_at_level[33] = {
57
-        404, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58
-          0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
56
+    uint32_t exit_at_level[33] = { 404 };
59 57
 
60 58
     unsigned i, j, p, code;
61 59
 
... ...
@@ -106,7 +104,7 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
106 106
 
107 107
 #ifdef V_DEBUG
108 108
         av_log(NULL, AV_LOG_INFO, " %d. code len %d code %d - ", p, bits[p], codes[p]);
109
-        init_get_bits(&gb, (uint_fast8_t *)&codes[p], bits[p]);
109
+        init_get_bits(&gb, (uint8_t *)&codes[p], bits[p]);
110 110
         for (i = 0; i < bits[p]; ++i)
111 111
             av_log(NULL, AV_LOG_INFO, "%s", get_bits1(&gb) ? "1" : "0");
112 112
         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)
206 206
 }
207 207
 
208 208
 void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
209
-                                  uint_fast16_t *y_list, int *flag,
209
+                                  uint16_t *y_list, int *flag,
210 210
                                   int multiplier, float *out, int samples)
211 211
 {
212 212
     int lx, ly, i;
... ...
@@ -30,17 +30,17 @@ extern const uint8_t ff_vorbis_encoding_channel_layout_offsets[8][8];
30 30
 extern const int64_t ff_vorbis_channel_layouts[9];
31 31
 
32 32
 typedef struct {
33
-    uint_fast16_t x;
34
-    uint_fast16_t sort;
35
-    uint_fast16_t low;
36
-    uint_fast16_t high;
33
+    uint16_t x;
34
+    uint16_t sort;
35
+    uint16_t low;
36
+    uint16_t high;
37 37
 } vorbis_floor1_entry;
38 38
 
39 39
 void ff_vorbis_ready_floor1_list(vorbis_floor1_entry * list, int values);
40 40
 unsigned int ff_vorbis_nth_root(unsigned int x, unsigned int n); // x^(1/n)
41 41
 int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num);
42 42
 void ff_vorbis_floor1_render_list(vorbis_floor1_entry * list, int values,
43
-                                  uint_fast16_t * y_list, int * flag,
43
+                                  uint16_t *y_list, int *flag,
44 44
                                   int multiplier, float * out, int samples);
45 45
 void vorbis_inverse_coupling(float *mag, float *ang, int blocksize);
46 46
 
... ...
@@ -49,11 +49,11 @@
49 49
 #include <assert.h>
50 50
 
51 51
 typedef struct {
52
-    uint_fast8_t dimensions;
53
-    uint_fast8_t lookup_type;
54
-    uint_fast8_t maxdepth;
55
-    VLC vlc;
56
-    float *codevectors;
52
+    uint8_t      dimensions;
53
+    uint8_t      lookup_type;
54
+    uint8_t      maxdepth;
55
+    VLC          vlc;
56
+    float       *codevectors;
57 57
     unsigned int nb_bits;
58 58
 } vorbis_codebook;
59 59
 
... ...
@@ -65,63 +65,63 @@ typedef
65 65
 int (* vorbis_floor_decode_func)
66 66
     (struct vorbis_context_s *, vorbis_floor_data *, float *);
67 67
 typedef struct {
68
-    uint_fast8_t floor_type;
68
+    uint8_t floor_type;
69 69
     vorbis_floor_decode_func decode;
70 70
     union vorbis_floor_u {
71 71
         struct vorbis_floor0_s {
72
-            uint_fast8_t  order;
73
-            uint_fast16_t rate;
74
-            uint_fast16_t bark_map_size;
75
-            int_fast32_t *map[2];
76
-            uint_fast32_t map_size[2];
77
-            uint_fast8_t  amplitude_bits;
78
-            uint_fast8_t  amplitude_offset;
79
-            uint_fast8_t  num_books;
80
-            uint_fast8_t *book_list;
72
+            uint8_t       order;
73
+            uint16_t      rate;
74
+            uint16_t      bark_map_size;
75
+            int32_t      *map[2];
76
+            uint32_t      map_size[2];
77
+            uint8_t       amplitude_bits;
78
+            uint8_t       amplitude_offset;
79
+            uint8_t       num_books;
80
+            uint8_t      *book_list;
81 81
             float        *lsp;
82 82
         } t0;
83 83
         struct vorbis_floor1_s {
84
-            uint_fast8_t partitions;
85
-            uint8_t      partition_class[32];
86
-            uint_fast8_t class_dimensions[16];
87
-            uint_fast8_t class_subclasses[16];
88
-            uint_fast8_t class_masterbook[16];
89
-            int_fast16_t subclass_books[16][8];
90
-            uint_fast8_t multiplier;
91
-            uint_fast16_t x_list_dim;
84
+            uint8_t       partitions;
85
+            uint8_t       partition_class[32];
86
+            uint8_t       class_dimensions[16];
87
+            uint8_t       class_subclasses[16];
88
+            uint8_t       class_masterbook[16];
89
+            int16_t       subclass_books[16][8];
90
+            uint8_t       multiplier;
91
+            uint16_t      x_list_dim;
92 92
             vorbis_floor1_entry *list;
93 93
         } t1;
94 94
     } data;
95 95
 } vorbis_floor;
96 96
 
97 97
 typedef struct {
98
-    uint_fast16_t type;
99
-    uint_fast32_t begin;
100
-    uint_fast32_t end;
98
+    uint16_t      type;
99
+    uint32_t      begin;
100
+    uint32_t      end;
101 101
     unsigned      partition_size;
102
-    uint_fast8_t  classifications;
103
-    uint_fast8_t  classbook;
104
-    int_fast16_t  books[64][8];
105
-    uint_fast8_t  maxpass;
106
-    uint_fast16_t ptns_to_read;
107
-    uint8_t *classifs;
102
+    uint8_t       classifications;
103
+    uint8_t       classbook;
104
+    int16_t       books[64][8];
105
+    uint8_t       maxpass;
106
+    uint16_t      ptns_to_read;
107
+    uint8_t      *classifs;
108 108
 } vorbis_residue;
109 109
 
110 110
 typedef struct {
111
-    uint_fast8_t  submaps;
112
-    uint_fast16_t coupling_steps;
113
-    uint_fast8_t *magnitude;
114
-    uint_fast8_t *angle;
115
-    uint_fast8_t *mux;
116
-    uint_fast8_t  submap_floor[16];
117
-    uint_fast8_t  submap_residue[16];
111
+    uint8_t       submaps;
112
+    uint16_t      coupling_steps;
113
+    uint8_t      *magnitude;
114
+    uint8_t      *angle;
115
+    uint8_t      *mux;
116
+    uint8_t       submap_floor[16];
117
+    uint8_t       submap_residue[16];
118 118
 } vorbis_mapping;
119 119
 
120 120
 typedef struct {
121
-    uint_fast8_t  blockflag;
122
-    uint_fast16_t windowtype;
123
-    uint_fast16_t transformtype;
124
-    uint_fast8_t  mapping;
121
+    uint8_t       blockflag;
122
+    uint16_t      windowtype;
123
+    uint16_t      transformtype;
124
+    uint8_t       mapping;
125 125
 } vorbis_mode;
126 126
 
127 127
 typedef struct vorbis_context_s {
... ...
@@ -131,27 +131,27 @@ typedef struct vorbis_context_s {
131 131
     FmtConvertContext fmt_conv;
132 132
 
133 133
     FFTContext mdct[2];
134
-    uint_fast8_t  first_frame;
135
-    uint_fast32_t version;
136
-    uint_fast8_t  audio_channels;
137
-    uint_fast32_t audio_samplerate;
138
-    uint_fast32_t bitrate_maximum;
139
-    uint_fast32_t bitrate_nominal;
140
-    uint_fast32_t bitrate_minimum;
141
-    uint_fast32_t blocksize[2];
134
+    uint8_t       first_frame;
135
+    uint32_t      version;
136
+    uint8_t       audio_channels;
137
+    uint32_t      audio_samplerate;
138
+    uint32_t      bitrate_maximum;
139
+    uint32_t      bitrate_nominal;
140
+    uint32_t      bitrate_minimum;
141
+    uint32_t      blocksize[2];
142 142
     const float  *win[2];
143
-    uint_fast16_t codebook_count;
143
+    uint16_t      codebook_count;
144 144
     vorbis_codebook *codebooks;
145
-    uint_fast8_t  floor_count;
145
+    uint8_t       floor_count;
146 146
     vorbis_floor *floors;
147
-    uint_fast8_t  residue_count;
147
+    uint8_t       residue_count;
148 148
     vorbis_residue *residues;
149
-    uint_fast8_t  mapping_count;
149
+    uint8_t       mapping_count;
150 150
     vorbis_mapping *mappings;
151
-    uint_fast8_t  mode_count;
151
+    uint8_t       mode_count;
152 152
     vorbis_mode  *modes;
153
-    uint_fast8_t  mode_number; // mode number for the current packet
154
-    uint_fast8_t  previous_window;
153
+    uint8_t       mode_number; // mode number for the current packet
154
+    uint8_t       previous_window;
155 155
     float        *channel_residues;
156 156
     float        *channel_floors;
157 157
     float        *saved;
... ...
@@ -241,7 +241,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
241 241
     uint8_t  *tmp_vlc_bits;
242 242
     uint32_t *tmp_vlc_codes;
243 243
     GetBitContext *gb = &vc->gb;
244
-    uint_fast16_t *codebook_multiplicands;
244
+    uint16_t *codebook_multiplicands;
245 245
 
246 246
     vc->codebook_count = get_bits(gb, 8) + 1;
247 247
 
... ...
@@ -359,7 +359,7 @@ static int vorbis_parse_setup_hdr_codebooks(vorbis_context *vc)
359 359
                 codebook_multiplicands[i] = get_bits(gb, codebook_value_bits);
360 360
 
361 361
                 AV_DEBUG(" multiplicands*delta+minmum : %e \n", (float)codebook_multiplicands[i]*codebook_delta_value+codebook_minimum_value);
362
-                AV_DEBUG(" multiplicand %d \n", codebook_multiplicands[i]);
362
+                AV_DEBUG(" multiplicand %u\n", codebook_multiplicands[i]);
363 363
             }
364 364
 
365 365
 // Weed out unused vlcs and build codevector vector
... ...
@@ -544,7 +544,7 @@ static int vorbis_parse_setup_hdr_floors(vorbis_context *vc)
544 544
             rangemax = (1 << rangebits);
545 545
             if (rangemax > vc->blocksize[1] / 2) {
546 546
                 av_log(vc->avccontext, AV_LOG_ERROR,
547
-                       "Floor value is too large for blocksize: %u (%"PRIuFAST32")\n",
547
+                       "Floor value is too large for blocksize: %u (%"PRIu32")\n",
548 548
                        rangemax, vc->blocksize[1] / 2);
549 549
                 return -1;
550 550
             }
... ...
@@ -652,7 +652,7 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
652 652
 
653 653
     for (i = 0; i < vc->residue_count; ++i) {
654 654
         vorbis_residue *res_setup = &vc->residues[i];
655
-        uint_fast8_t cascade[64];
655
+        uint8_t cascade[64];
656 656
         unsigned high_bits, low_bits;
657 657
 
658 658
         res_setup->type = get_bits(gb, 16);
... ...
@@ -666,7 +666,10 @@ static int vorbis_parse_setup_hdr_residues(vorbis_context *vc)
666 666
         if (res_setup->begin>res_setup->end ||
667 667
             res_setup->end > vc->avccontext->channels * vc->blocksize[1] / 2 ||
668 668
             (res_setup->end-res_setup->begin) / res_setup->partition_size > V_MAX_PARTITIONS) {
669
-            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);
669
+            av_log(vc->avccontext, AV_LOG_ERROR,
670
+                   "partition out of bounds: type, begin, end, size, blocksize: %"PRIu16", %"PRIu32", %"PRIu32", %u, %"PRIu32"\n",
671
+                   res_setup->type, res_setup->begin, res_setup->end,
672
+                   res_setup->partition_size, vc->blocksize[1] / 2);
670 673
             return -1;
671 674
         }
672 675
 
... ...
@@ -790,12 +793,12 @@ static void create_map(vorbis_context *vc, unsigned floor_number)
790 790
     vorbis_floor0 *vf;
791 791
     int idx;
792 792
     int blockflag, n;
793
-    int_fast32_t *map;
793
+    int32_t *map;
794 794
 
795 795
     for (blockflag = 0; blockflag < 2; ++blockflag) {
796 796
         n = vc->blocksize[blockflag] / 2;
797 797
         floors[floor_number].data.t0.map[blockflag] =
798
-            av_malloc((n+1) * sizeof(int_fast32_t)); // n + sentinel
798
+            av_malloc((n + 1) * sizeof(int32_t)); // n + sentinel
799 799
 
800 800
         map =  floors[floor_number].data.t0.map[blockflag];
801 801
         vf  = &floors[floor_number].data.t0;
... ...
@@ -1145,10 +1148,10 @@ static int vorbis_floor1_decode(vorbis_context *vc,
1145 1145
 {
1146 1146
     vorbis_floor1 *vf = &vfu->t1;
1147 1147
     GetBitContext *gb = &vc->gb;
1148
-    uint_fast16_t range_v[4] = { 256, 128, 86, 64 };
1149
-    unsigned range = range_v[vf->multiplier-1];
1150
-    uint_fast16_t floor1_Y[258];
1151
-    uint_fast16_t floor1_Y_final[258];
1148
+    uint16_t range_v[4] = { 256, 128, 86, 64 };
1149
+    unsigned range = range_v[vf->multiplier - 1];
1150
+    uint16_t floor1_Y[258];
1151
+    uint16_t floor1_Y_final[258];
1152 1152
     int floor1_flag[258];
1153 1153
     unsigned partition_class, cdim, cbits, csub, cval, offset, i, j;
1154 1154
     int book, adx, ady, dy, off, predicted, err;
... ...
@@ -1250,7 +1253,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
1250 1250
             floor1_Y_final[i] = predicted;
1251 1251
         }
1252 1252
 
1253
-        AV_DEBUG(" Decoded floor(%d) = %d / val %u\n",
1253
+        AV_DEBUG(" Decoded floor(%d) = %u / val %u\n",
1254 1254
                  vf->list[i].x, floor1_Y_final[i], val);
1255 1255
     }
1256 1256
 
... ...
@@ -1268,7 +1271,7 @@ static int vorbis_floor1_decode(vorbis_context *vc,
1268 1268
 static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
1269 1269
                                                            vorbis_residue *vr,
1270 1270
                                                            unsigned ch,
1271
-                                                           uint_fast8_t *do_not_decode,
1271
+                                                           uint8_t *do_not_decode,
1272 1272
                                                            float *vec,
1273 1273
                                                            unsigned vlen,
1274 1274
                                                            int vr_type)
... ...
@@ -1405,7 +1408,7 @@ static av_always_inline int vorbis_residue_decode_internal(vorbis_context *vc,
1405 1405
 
1406 1406
 static inline int vorbis_residue_decode(vorbis_context *vc, vorbis_residue *vr,
1407 1407
                                         unsigned ch,
1408
-                                        uint_fast8_t *do_not_decode,
1408
+                                        uint8_t *do_not_decode,
1409 1409
                                         float *vec, unsigned vlen)
1410 1410
 {
1411 1411
     if (vr->type == 2)
... ...
@@ -1453,12 +1456,12 @@ static int vorbis_parse_audio_packet(vorbis_context *vc)
1453 1453
     unsigned previous_window = vc->previous_window;
1454 1454
     unsigned mode_number, blockflag, blocksize;
1455 1455
     int i, j;
1456
-    uint_fast8_t no_residue[255];
1457
-    uint_fast8_t do_not_decode[255];
1456
+    uint8_t no_residue[255];
1457
+    uint8_t do_not_decode[255];
1458 1458
     vorbis_mapping *mapping;
1459 1459
     float *ch_res_ptr   = vc->channel_residues;
1460 1460
     float *ch_floor_ptr = vc->channel_floors;
1461
-    uint_fast8_t res_chan[255];
1461
+    uint8_t res_chan[255];
1462 1462
     unsigned res_num = 0;
1463 1463
     int retlen  = 0;
1464 1464
 
... ...
@@ -674,7 +674,7 @@ static float get_floor_average(vorbis_enc_floor * fc, float *coeffs, int i)
674 674
 }
675 675
 
676 676
 static void floor_fit(vorbis_enc_context *venc, vorbis_enc_floor *fc,
677
-                      float *coeffs, uint_fast16_t *posts, int samples)
677
+                      float *coeffs, uint16_t *posts, int samples)
678 678
 {
679 679
     int range = 255 / fc->multiplier + 1;
680 680
     int i;
... ...
@@ -706,7 +706,7 @@ static int render_point(int x0, int y0, int x1, int y1, int x)
706 706
 }
707 707
 
708 708
 static void floor_encode(vorbis_enc_context *venc, vorbis_enc_floor *fc,
709
-                         PutBitContext *pb, uint_fast16_t *posts,
709
+                         PutBitContext *pb, uint16_t *posts,
710 710
                          float *floor, int samples)
711 711
 {
712 712
     int range = 255 / fc->multiplier + 1;
... ...
@@ -1010,7 +1010,7 @@ static int vorbis_encode_frame(AVCodecContext *avccontext,
1010 1010
 
1011 1011
     for (i = 0; i < venc->channels; i++) {
1012 1012
         vorbis_enc_floor *fc = &venc->floors[mapping->floor[mapping->mux[i]]];
1013
-        uint_fast16_t posts[MAX_FLOOR_VALUES];
1013
+        uint16_t posts[MAX_FLOOR_VALUES];
1014 1014
         floor_fit(venc, fc, &venc->coeffs[i * samples], posts, samples);
1015 1015
         floor_encode(venc, fc, &pb, posts, &venc->floor[i * samples], samples);
1016 1016
     }
... ...
@@ -24,10 +24,6 @@
24 24
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 25
  */
26 26
 
27
-#define _BSD_SOURCE 1
28
-#define _NETBSD_SOURCE
29
-#define _XOPEN_SOURCE 600
30
-
31 27
 #include "libavformat/avformat.h"
32 28
 #if HAVE_DEV_BKTR_IOCTL_METEOR_H && HAVE_DEV_BKTR_IOCTL_BT848_H
33 29
 # include <dev/bktr/ioctl_meteor.h>
... ...
@@ -35,8 +35,6 @@
35 35
  * and Edouard Gomez <ed.gomez@free.fr>.
36 36
  */
37 37
 
38
-#define _XOPEN_SOURCE 600
39
-
40 38
 #include "config.h"
41 39
 #include "libavformat/avformat.h"
42 40
 #include <time.h>
... ...
@@ -25,7 +25,6 @@
25 25
  * http://tools.ietf.org/html/draft-pantos-http-live-streaming
26 26
  */
27 27
 
28
-#define _XOPEN_SOURCE 600
29 28
 #include "libavutil/avstring.h"
30 29
 #include "libavutil/intreadwrite.h"
31 30
 #include "libavutil/opt.h"
... ...
@@ -25,7 +25,6 @@
25 25
  * http://tools.ietf.org/html/draft-pantos-http-live-streaming
26 26
  */
27 27
 
28
-#define _XOPEN_SOURCE 600
29 28
 #include "libavutil/avstring.h"
30 29
 #include "avformat.h"
31 30
 #include "internal.h"
... ...
@@ -19,9 +19,8 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-/* needed for usleep() */
23
-#define _XOPEN_SOURCE 600
24 22
 #include <unistd.h>
23
+
25 24
 #include "libavutil/avstring.h"
26 25
 #include "libavutil/opt.h"
27 26
 #include "os_support.h"
... ...
@@ -109,7 +109,7 @@ typedef struct MOVStreamContext {
109 109
     unsigned int keyframe_count;
110 110
     int *keyframes;
111 111
     int time_scale;
112
-    int time_offset;      ///< time offset of the first edit list entry
112
+    int64_t time_offset;  ///< time offset of the first edit list entry
113 113
     int current_sample;
114 114
     unsigned int bytes_per_frame;
115 115
     unsigned int samples_per_frame;
... ...
@@ -616,7 +616,7 @@ static int mkv_write_tracks(AVFormatContext *s)
616 616
                 put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE);
617 617
                 if (!native_id) {
618 618
                     av_log(s, AV_LOG_ERROR, "Subtitle codec %d is not supported.\n", codec->codec_id);
619
-                    return AVERROR(EINVAL);
619
+                    return AVERROR(ENOSYS);
620 620
                 }
621 621
                 break;
622 622
             default:
... ...
@@ -2166,13 +2166,13 @@ free_and_return:
2166 2166
 static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
2167 2167
 {
2168 2168
     MOVStreamContext *sc;
2169
-    int i, edit_count;
2169
+    int i, edit_count, version;
2170 2170
 
2171 2171
     if (c->fc->nb_streams < 1)
2172 2172
         return 0;
2173 2173
     sc = c->fc->streams[c->fc->nb_streams-1]->priv_data;
2174 2174
 
2175
-    avio_r8(pb); /* version */
2175
+    version = avio_r8(pb); /* version */
2176 2176
     avio_rb24(pb); /* flags */
2177 2177
     edit_count = avio_rb32(pb); /* entries */
2178 2178
 
... ...
@@ -2180,9 +2180,15 @@ static int mov_read_elst(MOVContext *c, AVIOContext *pb, MOVAtom atom)
2180 2180
         return -1;
2181 2181
 
2182 2182
     for(i=0; i<edit_count; i++){
2183
-        int time;
2184
-        int duration = avio_rb32(pb); /* Track duration */
2185
-        time = avio_rb32(pb); /* Media time */
2183
+        int64_t time;
2184
+        int64_t duration;
2185
+        if (version == 1) {
2186
+            duration = avio_rb64(pb);
2187
+            time     = avio_rb64(pb);
2188
+        } else {
2189
+            duration = avio_rb32(pb); /* segment duration */
2190
+            time     = avio_rb32(pb); /* media time */
2191
+        }
2186 2192
         avio_rb32(pb); /* Media rate */
2187 2193
         if (i == 0 && time >= -1) {
2188 2194
             sc->time_offset = time != -1 ? time : -duration;
... ...
@@ -56,8 +56,7 @@ static const struct ogg_codec * const ogg_codecs[] = {
56 56
 };
57 57
 
58 58
 //FIXME We could avoid some structure duplication
59
-static int
60
-ogg_save (AVFormatContext * s)
59
+static int ogg_save(AVFormatContext *s)
61 60
 {
62 61
     struct ogg *ogg = s->priv_data;
63 62
     struct ogg_state *ost =
... ...
@@ -81,8 +80,7 @@ ogg_save (AVFormatContext * s)
81 81
     return 0;
82 82
 }
83 83
 
84
-static int
85
-ogg_restore (AVFormatContext * s, int discard)
84
+static int ogg_restore(AVFormatContext *s, int discard)
86 85
 {
87 86
     struct ogg *ogg = s->priv_data;
88 87
     AVIOContext *bc = s->pb;
... ...
@@ -110,8 +108,7 @@ ogg_restore (AVFormatContext * s, int discard)
110 110
     return 0;
111 111
 }
112 112
 
113
-static int
114
-ogg_reset (struct ogg * ogg)
113
+static int ogg_reset(struct ogg *ogg)
115 114
 {
116 115
     int i;
117 116
 
... ...
@@ -135,8 +132,7 @@ ogg_reset (struct ogg * ogg)
135 135
     return 0;
136 136
 }
137 137
 
138
-static const struct ogg_codec *
139
-ogg_find_codec (uint8_t * buf, int size)
138
+static const struct ogg_codec *ogg_find_codec(uint8_t *buf, int size)
140 139
 {
141 140
     int i;
142 141
 
... ...
@@ -148,8 +144,7 @@ ogg_find_codec (uint8_t * buf, int size)
148 148
     return NULL;
149 149
 }
150 150
 
151
-static int
152
-ogg_new_stream (AVFormatContext * s, uint32_t serial)
151
+static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
153 152
 {
154 153
 
155 154
     struct ogg *ogg = s->priv_data;
... ...
@@ -166,17 +161,18 @@ ogg_new_stream (AVFormatContext * s, uint32_t serial)
166 166
     os->buf = av_malloc(os->bufsize);
167 167
     os->header = -1;
168 168
 
169
-    st = av_new_stream (s, idx);
170
-    if (!st)
171
-        return AVERROR(ENOMEM);
169
+    if (new_avstream) {
170
+        st = av_new_stream(s, idx);
171
+        if (!st)
172
+            return AVERROR(ENOMEM);
172 173
 
173
-    av_set_pts_info(st, 64, 1, 1000000);
174
+        av_set_pts_info(st, 64, 1, 1000000);
175
+    }
174 176
 
175 177
     return idx;
176 178
 }
177 179
 
178
-static int
179
-ogg_new_buf(struct ogg *ogg, int idx)
180
+static int ogg_new_buf(struct ogg *ogg, int idx)
180 181
 {
181 182
     struct ogg_stream *os = ogg->streams + idx;
182 183
     uint8_t *nb = av_malloc(os->bufsize);
... ...
@@ -192,8 +188,7 @@ ogg_new_buf(struct ogg *ogg, int idx)
192 192
     return 0;
193 193
 }
194 194
 
195
-static int
196
-ogg_read_page (AVFormatContext * s, int *str)
195
+static int ogg_read_page(AVFormatContext *s, int *str)
197 196
 {
198 197
     AVIOContext *bc = s->pb;
199 198
     struct ogg *ogg = s->priv_data;
... ...
@@ -251,8 +246,10 @@ ogg_read_page (AVFormatContext * s, int *str)
251 251
             }
252 252
             ogg->curidx   = -1;
253 253
             ogg->nstreams = 0;
254
+            idx = ogg_new_stream(s, serial, 0);
255
+        } else {
256
+            idx = ogg_new_stream(s, serial, 1);
254 257
         }
255
-        idx = ogg_new_stream (s, serial);
256 258
         if (idx < 0)
257 259
             return -1;
258 260
     }
... ...
@@ -308,8 +305,8 @@ ogg_read_page (AVFormatContext * s, int *str)
308 308
     return 0;
309 309
 }
310 310
 
311
-static int
312
-ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpos)
311
+static int ogg_packet(AVFormatContext *s, int *str, int *dstart, int *dsize,
312
+                      int64_t *fpos)
313 313
 {
314 314
     struct ogg *ogg = s->priv_data;
315 315
     int idx, i;
... ...
@@ -439,8 +436,7 @@ ogg_packet (AVFormatContext * s, int *str, int *dstart, int *dsize, int64_t *fpo
439 439
     return 0;
440 440
 }
441 441
 
442
-static int
443
-ogg_get_headers (AVFormatContext * s)
442
+static int ogg_get_headers(AVFormatContext *s)
444 443
 {
445 444
     struct ogg *ogg = s->priv_data;
446 445
 
... ...
@@ -456,8 +452,7 @@ ogg_get_headers (AVFormatContext * s)
456 456
     return 0;
457 457
 }
458 458
 
459
-static int
460
-ogg_get_length (AVFormatContext * s)
459
+static int ogg_get_length(AVFormatContext *s)
461 460
 {
462 461
     struct ogg *ogg = s->priv_data;
463 462
     int i;
... ...
@@ -505,9 +500,7 @@ ogg_get_length (AVFormatContext * s)
505 505
     return 0;
506 506
 }
507 507
 
508
-
509
-static int
510
-ogg_read_header (AVFormatContext * s, AVFormatParameters * ap)
508
+static int ogg_read_header(AVFormatContext *s, AVFormatParameters *ap)
511 509
 {
512 510
     struct ogg *ogg = s->priv_data;
513 511
     int i;
... ...
@@ -558,8 +551,7 @@ static int64_t ogg_calc_pts(AVFormatContext *s, int idx, int64_t *dts)
558 558
     return pts;
559 559
 }
560 560
 
561
-static int
562
-ogg_read_packet (AVFormatContext * s, AVPacket * pkt)
561
+static int ogg_read_packet(AVFormatContext *s, AVPacket *pkt)
563 562
 {
564 563
     struct ogg *ogg;
565 564
     struct ogg_stream *os;
... ...
@@ -599,9 +591,7 @@ retry:
599 599
     return psize;
600 600
 }
601 601
 
602
-
603
-static int
604
-ogg_read_close (AVFormatContext * s)
602
+static int ogg_read_close(AVFormatContext *s)
605 603
 {
606 604
     struct ogg *ogg = s->priv_data;
607 605
     int i;
... ...
@@ -614,10 +604,8 @@ ogg_read_close (AVFormatContext * s)
614 614
     return 0;
615 615
 }
616 616
 
617
-
618
-static int64_t
619
-ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
620
-                    int64_t pos_limit)
617
+static int64_t ogg_read_timestamp(AVFormatContext *s, int stream_index,
618
+                                  int64_t *pos_arg, int64_t pos_limit)
621 619
 {
622 620
     struct ogg *ogg = s->priv_data;
623 621
     struct ogg_stream *os = ogg->streams + stream_index;
... ...
@@ -640,7 +628,8 @@ ogg_read_timestamp (AVFormatContext * s, int stream_index, int64_t * pos_arg,
640 640
     return pts;
641 641
 }
642 642
 
643
-static int ogg_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp, int flags)
643
+static int ogg_read_seek(AVFormatContext *s, int stream_index,
644
+                         int64_t timestamp, int flags)
644 645
 {
645 646
     struct ogg *ogg = s->priv_data;
646 647
     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
660 660
 
661 661
 static int ogg_probe(AVProbeData *p)
662 662
 {
663
-    if (p->buf[0] == 'O' && p->buf[1] == 'g' &&
664
-        p->buf[2] == 'g' && p->buf[3] == 'S' &&
665
-        p->buf[4] == 0x0 && p->buf[5] <= 0x7 )
663
+    if (!memcmp("OggS", p->buf, 5) && p->buf[5] <= 0x7)
666 664
         return AVPROBE_SCORE_MAX;
667
-    else
668
-        return 0;
665
+    return 0;
669 666
 }
670 667
 
671 668
 AVInputFormat ff_ogg_demuxer = {
672
-    "ogg",
673
-    NULL_IF_CONFIG_SMALL("Ogg"),
674
-    sizeof (struct ogg),
675
-    ogg_probe,
676
-    ogg_read_header,
677
-    ogg_read_packet,
678
-    ogg_read_close,
679
-    ogg_read_seek,
680
-    ogg_read_timestamp,
681
-    .extensions = "ogg",
682
-    .flags = AVFMT_GENERIC_INDEX,
669
+    .name           = "ogg",
670
+    .long_name      = NULL_IF_CONFIG_SMALL("Ogg"),
671
+    .priv_data_size = sizeof(struct ogg),
672
+    .read_probe     = ogg_probe,
673
+    .read_header    = ogg_read_header,
674
+    .read_packet    = ogg_read_packet,
675
+    .read_close     = ogg_read_close,
676
+    .read_seek      = ogg_read_seek,
677
+    .read_timestamp = ogg_read_timestamp,
678
+    .extensions     = "ogg",
679
+    .flags          = AVFMT_GENERIC_INDEX,
683 680
 };
... ...
@@ -22,7 +22,6 @@
22 22
 
23 23
 /* needed by inet_aton() */
24 24
 #define _SVID_SOURCE
25
-#define _DARWIN_C_SOURCE
26 25
 
27 26
 #include "config.h"
28 27
 #include "avformat.h"
... ...
@@ -19,9 +19,6 @@
19 19
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 20
  */
21 21
 
22
-/* needed for gethostname() */
23
-#define _XOPEN_SOURCE 600
24
-
25 22
 #include "libavcodec/get_bits.h"
26 23
 #include "avformat.h"
27 24
 #include "mpegts.h"
... ...
@@ -266,6 +266,8 @@ static int qdm2_parse_packet(AVFormatContext *s, PayloadContext *qdm,
266 266
              * to the decoder that it is OK to initialize. */
267 267
             st->codec->codec_id = CODEC_ID_QDM2;
268 268
         }
269
+        if (st->codec->codec_id == CODEC_ID_NONE)
270
+            return AVERROR(EAGAIN);
269 271
 
270 272
         /* subpackets */
271 273
         while (end - p >= 4) {
... ...
@@ -25,7 +25,7 @@
25 25
  */
26 26
 
27 27
 #define _BSD_SOURCE     /* Needed for using struct ip_mreq with recent glibc */
28
-#define _DARWIN_C_SOURCE /* Needed for using IP_MULTICAST_TTL on OS X */
28
+
29 29
 #include "avformat.h"
30 30
 #include "avio_internal.h"
31 31
 #include "libavutil/parseutils.h"
... ...
@@ -17,10 +17,8 @@
17 17
  */
18 18
 
19 19
 #ifdef __APPLE__
20
-#undef _POSIX_C_SOURCE
21 20
 #include <sys/sysctl.h>
22 21
 #elif defined(__OpenBSD__)
23
-#undef _POSIX_C_SOURCE
24 22
 #include <sys/param.h>
25 23
 #include <sys/sysctl.h>
26 24
 #include <machine/cpu.h>
... ...
@@ -1875,23 +1875,23 @@ static int packedCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
1875 1875
     return srcSliceH;
1876 1876
 }
1877 1877
 
1878
-#define DITHER_COPY(dst, dstStride, src, srcStride, bswap)\
1878
+#define DITHER_COPY(dst, dstStride, src, srcStride, bswap, dbswap)\
1879 1879
     uint16_t scale= dither_scale[dst_depth-1][src_depth-1];\
1880 1880
     int shift= src_depth-dst_depth + dither_scale[src_depth-2][dst_depth-1];\
1881 1881
     for (i = 0; i < height; i++) {\
1882 1882
         uint8_t *dither= dithers[src_depth-9][i&7];\
1883 1883
         for (j = 0; j < length-7; j+=8){\
1884
-            dst[j+0] = (bswap(src[j+0]) + dither[0])*scale>>shift;\
1885
-            dst[j+1] = (bswap(src[j+1]) + dither[1])*scale>>shift;\
1886
-            dst[j+2] = (bswap(src[j+2]) + dither[2])*scale>>shift;\
1887
-            dst[j+3] = (bswap(src[j+3]) + dither[3])*scale>>shift;\
1888
-            dst[j+4] = (bswap(src[j+4]) + dither[4])*scale>>shift;\
1889
-            dst[j+5] = (bswap(src[j+5]) + dither[5])*scale>>shift;\
1890
-            dst[j+6] = (bswap(src[j+6]) + dither[6])*scale>>shift;\
1891
-            dst[j+7] = (bswap(src[j+7]) + dither[7])*scale>>shift;\
1884
+            dst[j+0] = dbswap((bswap(src[j+0]) + dither[0])*scale>>shift);\
1885
+            dst[j+1] = dbswap((bswap(src[j+1]) + dither[1])*scale>>shift);\
1886
+            dst[j+2] = dbswap((bswap(src[j+2]) + dither[2])*scale>>shift);\
1887
+            dst[j+3] = dbswap((bswap(src[j+3]) + dither[3])*scale>>shift);\
1888
+            dst[j+4] = dbswap((bswap(src[j+4]) + dither[4])*scale>>shift);\
1889
+            dst[j+5] = dbswap((bswap(src[j+5]) + dither[5])*scale>>shift);\
1890
+            dst[j+6] = dbswap((bswap(src[j+6]) + dither[6])*scale>>shift);\
1891
+            dst[j+7] = dbswap((bswap(src[j+7]) + dither[7])*scale>>shift);\
1892 1892
         }\
1893 1893
         for (; j < length; j++)\
1894
-            dst[j] = (bswap(src[j]) + dither[j&7])*scale>>shift;\
1894
+            dst[j] = dbswap((bswap(src[j]) + dither[j&7])*scale>>shift);\
1895 1895
         dst += dstStride;\
1896 1896
         src += srcStride;\
1897 1897
     }
... ...
@@ -1921,42 +1921,66 @@ static int planarCopyWrapper(SwsContext *c, const uint8_t* src[], int srcStride[
1921 1921
             ) {
1922 1922
                 const int src_depth = av_pix_fmt_descriptors[c->srcFormat].comp[plane].depth_minus1+1;
1923 1923
                 const int dst_depth = av_pix_fmt_descriptors[c->dstFormat].comp[plane].depth_minus1+1;
1924
-                uint16_t *srcPtr2 = (uint16_t*)srcPtr;
1924
+                const uint16_t *srcPtr2 = (const uint16_t*)srcPtr;
1925 1925
                 uint16_t *dstPtr2 = (uint16_t*)dstPtr;
1926 1926
 
1927 1927
                 if (dst_depth == 8) {
1928 1928
                     if(isBE(c->srcFormat) == HAVE_BIGENDIAN){
1929
-                        DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, )
1929
+                        DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, , )
1930 1930
                     } else {
1931
-                        DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, av_bswap16)
1931
+                        DITHER_COPY(dstPtr, dstStride[plane], srcPtr2, srcStride[plane]/2, av_bswap16, )
1932 1932
                     }
1933 1933
                 } else if (src_depth == 8) {
1934 1934
                     for (i = 0; i < height; i++) {
1935
-                        for (j = 0; j < length; j++)
1936
-                            dstPtr2[j] = (srcPtr[j]<<(dst_depth-8)) |
1937
-                                (srcPtr[j]>>(2*8-dst_depth));
1935
+                        if(isBE(c->dstFormat)){
1936
+                            for (j = 0; j < length; j++)
1937
+                                AV_WB16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
1938
+                                                     (srcPtr[j]>>(2*8-dst_depth)));
1939
+                        } else {
1940
+                            for (j = 0; j < length; j++)
1941
+                                AV_WL16(&dstPtr2[j], (srcPtr[j]<<(dst_depth-8)) |
1942
+                                                     (srcPtr[j]>>(2*8-dst_depth)));
1943
+                        }
1938 1944
                         dstPtr2 += dstStride[plane]/2;
1939 1945
                         srcPtr  += srcStride[plane];
1940 1946
                     }
1941 1947
                 } else if (src_depth <= dst_depth) {
1942 1948
                     for (i = 0; i < height; i++) {
1943
-                        if(isBE(c->dstFormat)){
1944
-                            for (j = 0; j < length; j++)
1945
-                                AV_WB16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
1946
-                                                     (srcPtr2[j]>>(2*src_depth-dst_depth)));
1947
-                        }else{
1948
-                            for (j = 0; j < length; j++)
1949
-                                AV_WL16(&dstPtr2[j], (srcPtr2[j]<<(dst_depth-src_depth)) |
1950
-                                                     (srcPtr2[j]>>(2*src_depth-dst_depth)));
1949
+#define COPY_UP(r,w) \
1950
+    for (j = 0; j < length; j++){ \
1951
+        unsigned int v= r(&srcPtr2[j]);\
1952
+        w(&dstPtr2[j], (v<<(dst_depth-src_depth)) | \
1953
+                       (v>>(2*src_depth-dst_depth)));\
1954
+    }
1955
+                        if(isBE(c->srcFormat)){
1956
+                            if(isBE(c->dstFormat)){
1957
+                                COPY_UP(AV_RB16, AV_WB16)
1958
+                            } else {
1959
+                                COPY_UP(AV_RB16, AV_WL16)
1960
+                            }
1961
+                        } else {
1962
+                            if(isBE(c->dstFormat)){
1963
+                                COPY_UP(AV_RL16, AV_WB16)
1964
+                            } else {
1965
+                                COPY_UP(AV_RL16, AV_WL16)
1966
+                            }
1951 1967
                         }
1952 1968
                         dstPtr2 += dstStride[plane]/2;
1953 1969
                         srcPtr2 += srcStride[plane]/2;
1954 1970
                     }
1955 1971
                 } else {
1956 1972
                     if(isBE(c->srcFormat) == HAVE_BIGENDIAN){
1957
-                        DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, )
1973
+                        if(isBE(c->dstFormat) == HAVE_BIGENDIAN){
1974
+                            DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, , )
1975
+                        } else {
1976
+                            DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, , av_bswap16)
1977
+                        }
1958 1978
                     }else{
1959
-                        DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16)
1979
+                        if(isBE(c->dstFormat) == HAVE_BIGENDIAN){
1980
+                            DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16, )
1981
+                        } else {
1982
+                            DITHER_COPY(dstPtr2, dstStride[plane]/2, srcPtr2, srcStride[plane]/2, av_bswap16, av_bswap16)
1983
+                        }
1960 1984
                     }
1961 1985
                 }
1962 1986
             } else if(is16BPS(c->srcFormat) && is16BPS(c->dstFormat)
... ...
@@ -358,6 +358,7 @@ const char *sws_format_name(enum PixelFormat format);
358 358
         || (x)==PIX_FMT_YUV422P10LE \
359 359
         || (x)==PIX_FMT_YUV422P10BE \
360 360
     )
361
+#define is9_OR_10BPS isNBPS //for ronald
361 362
 #define isBE(x) ((x)&1)
362 363
 #define isPlanar8YUV(x) (           \
363 364
            (x)==PIX_FMT_YUV410P     \
... ...
@@ -1678,6 +1678,8 @@ static inline void RENAME(LEToUV)(uint8_t *dstU, uint8_t *dstV, const uint8_t *s
1678 1678
     );
1679 1679
 #else
1680 1680
     int i;
1681
+    // FIXME I don't think this code is right for YUV444/422, since then h is not subsampled so
1682
+    // we need to skip each second pixel. Same for BEToUV.
1681 1683
     for (i=0; i<width; i++) {
1682 1684
         dstU[i]= src1[2*i + 1];
1683 1685
         dstV[i]= src2[2*i + 1];
... ...
@@ -1827,27 +1829,29 @@ static inline void RENAME(nv21ToUV)(uint8_t *dstU, uint8_t *dstV,
1827 1827
 }
1828 1828
 
1829 1829
 // FIXME Maybe dither instead.
1830
-#define YUV_NBPS(depth) \
1831
-static inline void RENAME(yuv ## depth ## ToUV)(uint8_t *dstU, uint8_t *dstV, \
1832
-                                     const uint16_t *srcU, const uint16_t *srcV, \
1833
-                                     long width, uint32_t *unused) \
1830
+#define YUV_NBPS(depth, endianness, rfunc) \
1831
+static inline void endianness ## depth ## ToUV_c(uint8_t *dstU, uint8_t *dstV, \
1832
+                                          const uint16_t *srcU, const uint16_t *srcV, \
1833
+                                          long width, uint32_t *unused) \
1834 1834
 { \
1835 1835
     int i; \
1836 1836
     for (i = 0; i < width; i++) { \
1837
-        dstU[i] = srcU[i]>>(depth-8); \
1838
-        dstV[i] = srcV[i]>>(depth-8); \
1837
+        dstU[i] = rfunc(&srcU[i])>>(depth-8); \
1838
+        dstV[i] = rfunc(&srcV[i])>>(depth-8); \
1839 1839
     } \
1840 1840
 } \
1841 1841
 \
1842
-static inline void RENAME(yuv ## depth ## ToY)(uint8_t *dstY, const uint16_t *srcY, long width, uint32_t *unused) \
1842
+static inline void endianness ## depth ## ToY_c(uint8_t *dstY, const uint16_t *srcY, long width, uint32_t *unused) \
1843 1843
 { \
1844 1844
     int i; \
1845 1845
     for (i = 0; i < width; i++) \
1846
-        dstY[i] = srcY[i]>>(depth-8); \
1846
+        dstY[i] = rfunc(&srcY[i])>>(depth-8); \
1847 1847
 } \
1848 1848
 
1849
-YUV_NBPS( 9)
1850
-YUV_NBPS(10)
1849
+YUV_NBPS( 9, LE, AV_RL16)
1850
+YUV_NBPS( 9, BE, AV_RB16)
1851
+YUV_NBPS(10, LE, AV_RL16)
1852
+YUV_NBPS(10, BE, AV_RB16)
1851 1853
 
1852 1854
 #if COMPILE_TEMPLATE_MMX
1853 1855
 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)
2978 2978
         case PIX_FMT_PAL8     :
2979 2979
         case PIX_FMT_BGR4_BYTE:
2980 2980
         case PIX_FMT_RGB4_BYTE: c->chrToYV12 = palToUV; break;
2981
-        case PIX_FMT_YUV420P9 : c->chrToYV12 = (void*)RENAME(yuv9ToUV ); break;
2982
-        case PIX_FMT_YUV422P10:
2983
-        case PIX_FMT_YUV420P10: c->chrToYV12 = (void*)RENAME(yuv10ToUV); break;
2981
+        case PIX_FMT_YUV420P9BE: c->chrToYV12 = BE9ToUV_c; break;
2982
+        case PIX_FMT_YUV420P9LE: c->chrToYV12 = LE9ToUV_c; break;
2983
+        case PIX_FMT_YUV422P10BE:
2984
+        case PIX_FMT_YUV420P10BE: c->chrToYV12 = BE10ToUV_c; break;
2985
+        case PIX_FMT_YUV422P10LE:
2986
+        case PIX_FMT_YUV420P10LE: c->chrToYV12 = LE10ToUV_c; break;
2984 2987
         case PIX_FMT_YUV420P16BE:
2985 2988
         case PIX_FMT_YUV422P16BE:
2986 2989
         case PIX_FMT_YUV444P16BE: c->chrToYV12 = RENAME(BEToUV); break;
... ...
@@ -3027,9 +3034,12 @@ static void RENAME(sws_init_swScale)(SwsContext *c)
3027 3027
     c->lumToYV12 = NULL;
3028 3028
     c->alpToYV12 = NULL;
3029 3029
     switch (srcFormat) {
3030
-    case PIX_FMT_YUV420P9 : c->lumToYV12 = (void*)RENAME(yuv9ToY ); break;
3031
-    case PIX_FMT_YUV422P10:
3032
-    case PIX_FMT_YUV420P10: c->lumToYV12 = (void*)RENAME(yuv10ToY); break;
3030
+    case PIX_FMT_YUV420P9BE: c->lumToYV12 = BE9ToY_c; break;
3031
+    case PIX_FMT_YUV420P9LE: c->lumToYV12 = LE9ToY_c; break;
3032
+    case PIX_FMT_YUV422P10BE:
3033
+    case PIX_FMT_YUV420P10BE: c->lumToYV12 = BE10ToY_c; break;
3034
+    case PIX_FMT_YUV422P10LE:
3035
+    case PIX_FMT_YUV420P10LE: c->lumToYV12 = LE10ToY_c; break;
3033 3036
     case PIX_FMT_YUYV422  :
3034 3037
     case PIX_FMT_YUV420P16BE:
3035 3038
     case PIX_FMT_YUV422P16BE:
... ...
@@ -107,15 +107,17 @@ const char *swscale_license(void)
107 107
         || (x)==PIX_FMT_YUV440P     \
108 108
         || (x)==PIX_FMT_MONOWHITE   \
109 109
         || (x)==PIX_FMT_MONOBLACK   \
110
+        || (x)==PIX_FMT_YUV420P9LE    \
111
+        || (x)==PIX_FMT_YUV420P10LE   \
110 112
         || (x)==PIX_FMT_YUV420P16LE   \
111 113
         || (x)==PIX_FMT_YUV422P16LE   \
112 114
         || (x)==PIX_FMT_YUV444P16LE   \
115
+        || (x)==PIX_FMT_YUV420P9BE    \
116
+        || (x)==PIX_FMT_YUV420P10BE   \
113 117
         || (x)==PIX_FMT_YUV420P16BE   \
114 118
         || (x)==PIX_FMT_YUV422P16BE   \
115 119
         || (x)==PIX_FMT_YUV444P16BE   \
116
-        || (x)==PIX_FMT_YUV420P9    \
117
-        || (x)==PIX_FMT_YUV420P10   \
118
-        || (x)==PIX_FMT_YUV422P10   \
120
+        || (x)==PIX_FMT_YUV422P10     \
119 121
     )
120 122
 
121 123
 int sws_isSupportedInput(enum PixelFormat pix_fmt)
... ...
@@ -143,12 +145,14 @@ int sws_isSupportedInput(enum PixelFormat pix_fmt)
143 143
         || (x)==PIX_FMT_GRAY8       \
144 144
         || (x)==PIX_FMT_YUV410P     \
145 145
         || (x)==PIX_FMT_YUV440P     \
146
-        || (x)==PIX_FMT_YUV420P9    \
147
-        || (x)==PIX_FMT_YUV420P10   \
148 146
         || (x)==PIX_FMT_YUV422P10   \
147
+        || (x)==PIX_FMT_YUV420P9LE    \
148
+        || (x)==PIX_FMT_YUV420P10LE   \
149 149
         || (x)==PIX_FMT_YUV420P16LE   \
150 150
         || (x)==PIX_FMT_YUV422P16LE   \
151 151
         || (x)==PIX_FMT_YUV444P16LE   \
152
+        || (x)==PIX_FMT_YUV420P9BE    \
153
+        || (x)==PIX_FMT_YUV420P10BE   \
152 154
         || (x)==PIX_FMT_YUV420P16BE   \
153 155
         || (x)==PIX_FMT_YUV422P16BE   \
154 156
         || (x)==PIX_FMT_YUV444P16BE   \
... ...
@@ -307,12 +307,12 @@ fate-h264-conformance-frext-hpcvfl_bcrm_a: CMD = framecrc  -i $(SAMPLES)/h264-co
307 307
 fate-h264-conformance-frext-hpcvflnl_bcrm_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/HPCVFLNL_BRCM_A.264 -vsync 0
308 308
 fate-h264-conformance-frext-hpcvmolq_brcm_b: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/HPCVMOLQ_BRCM_B.264
309 309
 fate-h264-conformance-frext-hpcvnl_brcm_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/HPCVNL_BRCM_A.264
310
-fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p16be
311
-fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p16be
312
-fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p16be
313
-fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p16be
314
-fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p16be
315
-fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p16be
310
+fate-h264-conformance-frext-pph10i1_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I1_Panasonic_A.264 -pix_fmt yuv420p10le
311
+fate-h264-conformance-frext-pph10i2_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I2_Panasonic_A.264 -pix_fmt yuv420p10le
312
+fate-h264-conformance-frext-pph10i3_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I3_Panasonic_A.264 -pix_fmt yuv420p10le
313
+fate-h264-conformance-frext-pph10i5_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I5_Panasonic_A.264 -pix_fmt yuv420p10le
314
+fate-h264-conformance-frext-pph10i6_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I6_Panasonic_A.264 -pix_fmt yuv420p10le
315
+fate-h264-conformance-frext-pph10i7_panasonic_a: CMD = framecrc  -i $(SAMPLES)/h264-conformance/FRext/PPH10I7_Panasonic_A.264 -pix_fmt yuv420p10le
316 316
 fate-h264-conformance-hcbp2_hhi_a: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCBP2_HHI_A.264
317 317
 fate-h264-conformance-hcmp1_hhi_a: CMD = framecrc  -vsync 0 -strict 1 -i $(SAMPLES)/h264-conformance/HCMP1_HHI_A.264
318 318
 fate-h264-conformance-ls_sva_d: CMD = framecrc  -i $(SAMPLES)/h264-conformance/LS_SVA_D.264
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 2764800, 0xf69f33f5
2
-0, 3600, 2764800, 0x8d602e2f
3
-0, 7200, 2764800, 0xe2111955
4
-0, 10800, 2764800, 0xbbe76d10
5
-0, 14400, 2764800, 0x81cbbb10
6
-0, 18000, 2764800, 0xb5259536
7
-0, 21600, 2764800, 0x4972ded4
8
-0, 25200, 2764800, 0xc726c878
9
-0, 28800, 2764800, 0xd8a2b4fc
10
-0, 32400, 2764800, 0xaa4b80f7
1
+0, 0, 2764800, 0xcc4df07d
2
+0, 3600, 2764800, 0x85f9e6d4
3
+0, 7200, 2764800, 0x23ffe90d
4
+0, 10800, 2764800, 0xf0a6d453
5
+0, 14400, 2764800, 0x913a6392
6
+0, 18000, 2764800, 0xcc5f9736
7
+0, 21600, 2764800, 0x43f9f9ce
8
+0, 25200, 2764800, 0xc874b44e
9
+0, 28800, 2764800, 0x83b665e6
10
+0, 32400, 2764800, 0x5ea2e31e
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 2764800, 0x8c3e963e
2
-0, 3600, 2764800, 0xa1b0f891
3
-0, 7200, 2764800, 0xcd090f45
4
-0, 10800, 2764800, 0x2df70987
5
-0, 14400, 2764800, 0x66d22478
6
-0, 18000, 2764800, 0x64b0ddef
7
-0, 21600, 2764800, 0xdd86fb62
8
-0, 25200, 2764800, 0x36fc36d4
9
-0, 28800, 2764800, 0xee32176f
10
-0, 32400, 2764800, 0x99c649b5
1
+0, 0, 2764800, 0x4f710132
2
+0, 3600, 2764800, 0x57e5b713
3
+0, 7200, 2764800, 0xcca01477
4
+0, 10800, 2764800, 0xa19a95cd
5
+0, 14400, 2764800, 0x700a757d
6
+0, 18000, 2764800, 0xd8c6f60f
7
+0, 21600, 2764800, 0x95a1bbc7
8
+0, 25200, 2764800, 0x0582077a
9
+0, 28800, 2764800, 0x91595f91
10
+0, 32400, 2764800, 0xf5fe034a
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 2764800, 0xe4289a64
2
-0, 3600, 2764800, 0x01ea4677
3
-0, 7200, 2764800, 0x7c1b00f4
4
-0, 10800, 2764800, 0xf51a4695
5
-0, 14400, 2764800, 0xe1dd8ace
6
-0, 18000, 2764800, 0xe9fd1996
7
-0, 21600, 2764800, 0x083ce1db
8
-0, 25200, 2764800, 0x2c5bc489
9
-0, 28800, 2764800, 0xb6d10e63
10
-0, 32400, 2764800, 0x813daf47
1
+0, 0, 2764800, 0xda69f69e
2
+0, 3600, 2764800, 0x29ed832f
3
+0, 7200, 2764800, 0xb3244cc4
4
+0, 10800, 2764800, 0xe41a312c
5
+0, 14400, 2764800, 0xac0b344b
6
+0, 18000, 2764800, 0xc585aa20
7
+0, 21600, 2764800, 0x0952054c
8
+0, 25200, 2764800, 0xd1a02f87
9
+0, 28800, 2764800, 0xfcbfe87c
10
+0, 32400, 2764800, 0xe4e9b8a2
... ...
@@ -1,19 +1,19 @@
1
-0, 0, 6220800, 0x26bc0f20
2
-0, 3600, 6220800, 0x69acba0c
3
-0, 7200, 6220800, 0x10d17202
4
-0, 10800, 6220800, 0x790d98f1
5
-0, 14400, 6220800, 0x71fe35c2
6
-0, 18000, 6220800, 0xc9d345cb
7
-0, 21600, 6220800, 0xcb4bad2e
8
-0, 25200, 6220800, 0x01604385
9
-0, 28800, 6220800, 0xe585bb5f
10
-0, 32400, 6220800, 0xc9d345cb
11
-0, 36000, 6220800, 0x2bdf0dd0
12
-0, 39600, 6220800, 0x79794ac4
13
-0, 43200, 6220800, 0x106afcdf
14
-0, 46800, 6220800, 0xc9d345cb
15
-0, 50400, 6220800, 0x106afcdf
16
-0, 54000, 6220800, 0xc9d345cb
17
-0, 57600, 6220800, 0x106afcdf
18
-0, 61200, 6220800, 0xc9d345cb
19
-0, 64800, 6220800, 0xf0b8dde0
1
+0, 0, 6220800, 0xca2a2a5e
2
+0, 3600, 6220800, 0x8009a65e
3
+0, 7200, 6220800, 0x63e72b3b
4
+0, 10800, 6220800, 0x7459a1cc
5
+0, 14400, 6220800, 0x02191aa9
6
+0, 18000, 6220800, 0x88dca590
7
+0, 21600, 6220800, 0x56dd150a
8
+0, 25200, 6220800, 0x5f56a56f
9
+0, 28800, 6220800, 0x67ada4b7
10
+0, 32400, 6220800, 0x88dca590
11
+0, 36000, 6220800, 0xd3b09fe5
12
+0, 39600, 6220800, 0x2223998c
13
+0, 43200, 6220800, 0x5e5b2da5
14
+0, 46800, 6220800, 0x88dca590
15
+0, 50400, 6220800, 0x5e5b2da5
16
+0, 54000, 6220800, 0x88dca590
17
+0, 57600, 6220800, 0x5e5b2da5
18
+0, 61200, 6220800, 0x88dca590
19
+0, 64800, 6220800, 0x26e1ec8b
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 6220800, 0x77a0ee6a
2
-0, 3600, 6220800, 0x1850d87c
3
-0, 7200, 6220800, 0x116ac02c
4
-0, 10800, 6220800, 0xb834fb9d
5
-0, 14400, 6220800, 0xabfae062
6
-0, 18000, 6220800, 0x717845a7
7
-0, 21600, 6220800, 0xb246fc4b
8
-0, 25200, 6220800, 0x2cf2769d
9
-0, 28800, 6220800, 0xf8ac6a4a
10
-0, 32400, 6220800, 0xfa278467
1
+0, 0, 6220800, 0x1df58ce9
2
+0, 3600, 6220800, 0x8f2859ce
3
+0, 7200, 6220800, 0x229cc7ff
4
+0, 10800, 6220800, 0x73e86984
5
+0, 14400, 6220800, 0xb6d4504b
6
+0, 18000, 6220800, 0x4e7d4883
7
+0, 21600, 6220800, 0xbec3f0f7
8
+0, 25200, 6220800, 0x1d9af065
9
+0, 28800, 6220800, 0x44851549
10
+0, 32400, 6220800, 0xfcf8728e
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 6220800, 0x738b0778
2
-0, 3600, 6220800, 0x04821310
3
-0, 7200, 6220800, 0x4837f3d9
4
-0, 10800, 6220800, 0x5e246bfe
5
-0, 14400, 6220800, 0xdb46d88c
6
-0, 18000, 6220800, 0x74b67352
7
-0, 21600, 6220800, 0x1cdb5be8
8
-0, 25200, 6220800, 0x2d5e5f1e
9
-0, 28800, 6220800, 0x429c5928
10
-0, 32400, 6220800, 0x8e227f6c
1
+0, 0, 6220800, 0x408daf70
2
+0, 3600, 6220800, 0x59b254a3
3
+0, 7200, 6220800, 0x4cf4279c
4
+0, 10800, 6220800, 0x5c9437ae
5
+0, 14400, 6220800, 0x986c3eb8
6
+0, 18000, 6220800, 0x23fd883e
7
+0, 21600, 6220800, 0x84f222fe
8
+0, 25200, 6220800, 0xe7f91107
9
+0, 28800, 6220800, 0xb544b31e
10
+0, 32400, 6220800, 0x1ebdde56
... ...
@@ -1,10 +1,10 @@
1
-0, 0, 6220800, 0x6616177e
2
-0, 3600, 6220800, 0xf3fe7a1c
3
-0, 7200, 6220800, 0x44f0fab6
4
-0, 10800, 6220800, 0x109ff851
5
-0, 14400, 6220800, 0x9501f055
6
-0, 18000, 6220800, 0x603d6e3d
7
-0, 21600, 6220800, 0x42126cfb
8
-0, 25200, 6220800, 0x113169e8
9
-0, 28800, 6220800, 0xe8f64949
10
-0, 32400, 6220800, 0x89488caf
1
+0, 0, 6220800, 0xf81873fe
2
+0, 3600, 6220800, 0x7b96fbdc
3
+0, 7200, 6220800, 0x75dbafc4
4
+0, 10800, 6220800, 0x7524301e
5
+0, 14400, 6220800, 0x0f3621ab
6
+0, 18000, 6220800, 0xa5e25b35
7
+0, 21600, 6220800, 0x063a8116
8
+0, 25200, 6220800, 0x48ebc8ff
9
+0, 28800, 6220800, 0x1f635df8
10
+0, 32400, 6220800, 0xe282c8bd
... ...
@@ -27,9 +27,11 @@ uyvy422             adcf64516a19fce44df77082bdb16291
27 27
 yuv410p             2d9225153c83ee1132397d619d94d1b3
28 28
 yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
29 29
 yuv420p             eba2f135a08829387e2f698ff72a2939
30
+yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
30 31
 yuv420p10le         4228ee628c6deec123a13b9784516cc7
31 32
 yuv420p16be         16c009a235cd52b74791a895423152a3
32 33
 yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
34
+yuv420p9be          ce880fa07830e5297c22acf6e20555ce
33 35
 yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
34 36
 yuv422p             c9bba4529821d796a6ab09f6a5fd355a
35 37
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
... ...
@@ -27,9 +27,11 @@ uyvy422             adcf64516a19fce44df77082bdb16291
27 27
 yuv410p             2d9225153c83ee1132397d619d94d1b3
28 28
 yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
29 29
 yuv420p             eba2f135a08829387e2f698ff72a2939
30
+yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
30 31
 yuv420p10le         4228ee628c6deec123a13b9784516cc7
31 32
 yuv420p16be         16c009a235cd52b74791a895423152a3
32 33
 yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
34
+yuv420p9be          ce880fa07830e5297c22acf6e20555ce
33 35
 yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
34 36
 yuv422p             c9bba4529821d796a6ab09f6a5fd355a
35 37
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
... ...
@@ -27,9 +27,11 @@ uyvy422             adcf64516a19fce44df77082bdb16291
27 27
 yuv410p             2d9225153c83ee1132397d619d94d1b3
28 28
 yuv411p             8b298af3e43348ca1b11eb8a3252ac6c
29 29
 yuv420p             eba2f135a08829387e2f698ff72a2939
30
+yuv420p10be         7605e266c088d0fcf68c7b27c3ceff5f
30 31
 yuv420p10le         4228ee628c6deec123a13b9784516cc7
31 32
 yuv420p16be         16c009a235cd52b74791a895423152a3
32 33
 yuv420p16le         2d59c4f1d0314a5a957a7cfc4b6fabcc
34
+yuv420p9be          ce880fa07830e5297c22acf6e20555ce
33 35
 yuv420p9le          16543fda8f87d94a6cf857d2e8d4461a
34 36
 yuv422p             c9bba4529821d796a6ab09f6a5fd355a
35 37
 yuv422p10le         d0607c260a45c973e6639f4e449730ad
... ...
@@ -27,9 +27,11 @@ uyvy422             314bd486277111a95d9369b944fa0400
27 27
 yuv410p             7df8f6d69b56a8dcb6c7ee908e5018b5
28 28
 yuv411p             1143e7c5cc28fe0922b051b17733bc4c
29 29
 yuv420p             fdad2d8df8985e3d17e73c71f713cb14
30
+yuv420p10be         6d335e75b553da590135cf8bb999610c
30 31
 yuv420p10le         d510ddbabefd03ef39ec943fcb51b709
31 32
 yuv420p16be         29a0265764530070f5cd3251cc01f66a
32 33
 yuv420p16le         6f3a265b084a78baec229238d9f7945f
34
+yuv420p9be          ec4983b7a949c0472110a7a2c58e278a
33 35
 yuv420p9le          c136dce5913a722eee44ab72cff664b2
34 36
 yuv422p             918e37701ee7377d16a8a6c119c56a40
35 37
 yuv422p10le         aeb0ef08a883f43429ca9d886d8fc095
... ...
@@ -27,9 +27,11 @@ uyvy422             ffbd36720c77398d9a0d03ce2625928f
27 27
 yuv410p             7bfb39d7afb49d6a6173e6b23ae321eb
28 28
 yuv411p             4a90048cc3a65fac150e53289700efe1
29 29
 yuv420p             2e6d6062e8cad37fb3ab2c433b55f382
30
+yuv420p10be         df97d20b3b4a10c174d4360552c4160d
30 31
 yuv420p10le         4b5249208602b941332945c926f80ae9
31 32
 yuv420p16be         539076782902664a8acf381bf4f713e8
32 33
 yuv420p16le         0f609e588e5a258644ef85170d70e030
34
+yuv420p9be          be40ec975fb2873891643cbbbddbc3b0
33 35
 yuv420p9le          7e606310d3f5ff12badf911e8f333471
34 36
 yuv422p             d7f5cb44d9b0210d66d6a8762640ab34
35 37
 yuv422p10le         11b57f2bd9661024153f3973b9090cdb