Browse code

Merge remote-tracking branch 'qatar/master'

* qatar/master:
asf: only set index_read if the index contained entries.
cabac: add overread protection to BRANCHLESS_GET_CABAC().
cabac: increment jump locations by one in callers of BRANCHLESS_GET_CABAC().
cabac: remove unused argument from BRANCHLESS_GET_CABAC_UPDATE().
cabac: use struct+offset instead of memory operand in BRANCHLESS_GET_CABAC().
h264: add overread protection to get_cabac_bypass_sign_x86().
h264: reindent get_cabac_bypass_sign_x86().
h264: use struct offsets in get_cabac_bypass_sign_x86().
h264: fix overreads in cabac reader.
wmall: fix seeking.
lagarith: fix buffer overreads.
dvdec: drop unnecessary dv_tablegen.h #include
build: fix doc generation errors in parallel builds
Replace memset(0) by zero initializations.
faandct: Remove FAAN_POSTSCALE define and related code.
dvenc: print allowed profiles if the video doesn't conform to any of them.
avcodec_encode_{audio,video}: only reallocate output packet when it has non-zero size.
FATE: add a test for vp8 with changing frame size.
fate: add kgv1 fate test.
oggdec: calculate correct timestamps in Ogg/FLAC

Conflicts:
libavcodec/4xm.c
libavcodec/cook.c
libavcodec/dvdata.c
libavcodec/dvdsubdec.c
libavcodec/lagarith.c
libavcodec/lagarithrac.c
libavcodec/utils.c
tests/fate/video.mak

Merged-by: Michael Niedermayer <michaelni@gmx.at>

Michael Niedermayer authored on 2012/03/29 08:41:04
Showing 60 changed files
... ...
@@ -51,7 +51,7 @@ doc/%.1: TAG = MAN
51 51
 doc/%.1: doc/%.pod $(GENTEXI)
52 52
 	$(M)pod2man --section=1 --center=" " --release=" " $< > $@
53 53
 
54
-$(DOCS): | doc
54
+$(DOCS): | doc/
55 55
 
56 56
 install-progs-$(CONFIG_DOC): install-man
57 57
 
... ...
@@ -1416,7 +1416,7 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
1416 1416
 
1417 1417
     /* if the frame is not skipped, then display it */
1418 1418
     if (vp->bmp) {
1419
-        AVPicture pict;
1419
+        AVPicture pict = { { 0 } };
1420 1420
 #if CONFIG_AVFILTER
1421 1421
         if (vp->picref)
1422 1422
             avfilter_unref_buffer(vp->picref);
... ...
@@ -1426,7 +1426,6 @@ static int queue_picture(VideoState *is, AVFrame *src_frame, double pts1, int64_
1426 1426
         /* get a pointer on the bitmap */
1427 1427
         SDL_LockYUVOverlay (vp->bmp);
1428 1428
 
1429
-        memset(&pict, 0, sizeof(AVPicture));
1430 1429
         pict.data[0] = vp->bmp->pixels[0];
1431 1430
         pict.data[1] = vp->bmp->pixels[2];
1432 1431
         pict.data[2] = vp->bmp->pixels[1];
... ...
@@ -339,8 +339,7 @@ static int resolve_host(struct in_addr *sin_addr, const char *hostname)
339 339
     if (!ff_inet_aton(hostname, sin_addr)) {
340 340
 #if HAVE_GETADDRINFO
341 341
         struct addrinfo *ai, *cur;
342
-        struct addrinfo hints;
343
-        memset(&hints, 0, sizeof(hints));
342
+        struct addrinfo hints = { 0 };
344 343
         hints.ai_family = AF_INET;
345 344
         if (getaddrinfo(hostname, NULL, &hints, &ai))
346 345
             return -1;
... ...
@@ -2835,7 +2834,7 @@ static int rtsp_parse_request(HTTPContext *c)
2835 2835
     char protocol[32];
2836 2836
     char line[1024];
2837 2837
     int len;
2838
-    RTSPMessageHeader header1, *header = &header1;
2838
+    RTSPMessageHeader header1 = { 0 }, *header = &header1;
2839 2839
 
2840 2840
     c->buffer_ptr[0] = '\0';
2841 2841
     p = c->buffer;
... ...
@@ -2861,7 +2860,6 @@ static int rtsp_parse_request(HTTPContext *c)
2861 2861
     }
2862 2862
 
2863 2863
     /* parse each header line */
2864
-    memset(header, 0, sizeof(*header));
2865 2864
     /* skip to next line */
2866 2865
     while (*p != '\n' && *p != '\0')
2867 2866
         p++;
... ...
@@ -4664,7 +4662,7 @@ static const OptionDef options[] = {
4664 4664
 
4665 4665
 int main(int argc, char **argv)
4666 4666
 {
4667
-    struct sigaction sigact;
4667
+    struct sigaction sigact = { { 0 } };
4668 4668
 
4669 4669
     parse_loglevel(argc, argv, options);
4670 4670
     av_register_all();
... ...
@@ -4682,7 +4680,6 @@ int main(int argc, char **argv)
4682 4682
 
4683 4683
     av_lfg_init(&random_state, av_get_random_seed());
4684 4684
 
4685
-    memset(&sigact, 0, sizeof(sigact));
4686 4685
     sigact.sa_handler = handle_child_exit;
4687 4686
     sigact.sa_flags = SA_NOCLDSTOP | SA_RESTART;
4688 4687
     sigaction(SIGCHLD, &sigact, 0);
... ...
@@ -578,7 +578,7 @@ static int decode_i_mb(FourXContext *f)
578 578
 static const uint8_t *read_huffman_tables(FourXContext *f,
579 579
                                           const uint8_t * const buf, int buf_size)
580 580
 {
581
-    int frequency[512];
581
+    int frequency[512] = { 0 };
582 582
     uint8_t flag[512];
583 583
     int up[512];
584 584
     uint8_t len_tab[257];
... ...
@@ -588,7 +588,6 @@ static const uint8_t *read_huffman_tables(FourXContext *f,
588 588
     const uint8_t *ptr_end = buf + buf_size;
589 589
     int j;
590 590
 
591
-    memset(frequency, 0, sizeof(frequency));
592 591
     memset(up, -1, sizeof(up));
593 592
 
594 593
     start = *ptr++;
... ...
@@ -691,10 +690,9 @@ static int decode_i2_frame(FourXContext *f, const uint8_t *buf, int length)
691 691
 
692 692
     for (y = 0; y < height; y += 16) {
693 693
         for (x = 0; x < width; x += 16) {
694
-            unsigned int color[4], bits;
694
+            unsigned int color[4] = { 0 }, bits;
695 695
             if (buf_end - buf < 8)
696 696
                 return -1;
697
-            memset(color, 0, sizeof(color));
698 697
             // warning following is purely guessed ...
699 698
             color[0] = bytestream2_get_le16u(&g3);
700 699
             color[1] = bytestream2_get_le16u(&g3);
... ...
@@ -714,7 +714,7 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
714 714
 {
715 715
     int start = 0, i, w, w2, g;
716 716
     int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels;
717
-    float dists[128], uplims[128];
717
+    float dists[128] = { 0 }, uplims[128];
718 718
     float maxvals[128];
719 719
     int fflag, minscaler;
720 720
     int its  = 0;
... ...
@@ -722,7 +722,6 @@ static void search_for_quantizers_twoloop(AVCodecContext *avctx,
722 722
     float minthr = INFINITY;
723 723
 
724 724
     //XXX: some heuristic to determine initial quantizers will reduce search time
725
-    memset(dists, 0, sizeof(dists));
726 725
     //determine zero bands and upper limits
727 726
     for (w = 0; w < sce->ics.num_windows; w += sce->ics.group_len[w]) {
728 727
         for (g = 0;  g < sce->ics.num_swb; g++) {
... ...
@@ -389,9 +389,8 @@ static av_unused FFPsyWindowInfo psy_3gpp_window(FFPsyContext *ctx,
389 389
     AacPsyChannel *pch  = &pctx->ch[channel];
390 390
     uint8_t grouping     = 0;
391 391
     int next_type        = pch->next_window_seq;
392
-    FFPsyWindowInfo wi;
392
+    FFPsyWindowInfo wi  = { { 0 } };
393 393
 
394
-    memset(&wi, 0, sizeof(wi));
395 394
     if (la) {
396 395
         float s[8], v;
397 396
         int switch_to_eight = 0;
... ...
@@ -785,9 +784,8 @@ static FFPsyWindowInfo psy_lame_window(FFPsyContext *ctx, const float *audio,
785 785
     int uselongblock = 1;
786 786
     int attacks[AAC_NUM_BLOCKS_SHORT + 1] = { 0 };
787 787
     int i;
788
-    FFPsyWindowInfo wi;
788
+    FFPsyWindowInfo wi = { { 0 } };
789 789
 
790
-    memset(&wi, 0, sizeof(wi));
791 790
     if (la) {
792 791
         float hpfsmpl[AAC_BLOCK_SIZE_LONG];
793 792
         float const *pf = hpfsmpl;
... ...
@@ -753,9 +753,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
753 753
     int downmix_output;
754 754
     int cpl_in_use;
755 755
     GetBitContext *gbc = &s->gbc;
756
-    uint8_t bit_alloc_stages[AC3_MAX_CHANNELS];
757
-
758
-    memset(bit_alloc_stages, 0, AC3_MAX_CHANNELS);
756
+    uint8_t bit_alloc_stages[AC3_MAX_CHANNELS] = { 0 };
759 757
 
760 758
     /* block switch flags */
761 759
     different_transforms = 0;
... ...
@@ -1035,9 +1035,7 @@ static int decode_blocks_ind(ALSDecContext *ctx, unsigned int ra_frame,
1035 1035
                              unsigned int *js_blocks)
1036 1036
 {
1037 1037
     unsigned int b;
1038
-    ALSBlockData bd;
1039
-
1040
-    memset(&bd, 0, sizeof(ALSBlockData));
1038
+    ALSBlockData bd = { 0 };
1041 1039
 
1042 1040
     bd.ra_block         = ra_frame;
1043 1041
     bd.const_block      = ctx->const_block;
... ...
@@ -1078,9 +1076,7 @@ static int decode_blocks(ALSDecContext *ctx, unsigned int ra_frame,
1078 1078
     ALSSpecificConfig *sconf = &ctx->sconf;
1079 1079
     unsigned int offset = 0;
1080 1080
     unsigned int b;
1081
-    ALSBlockData bd[2];
1082
-
1083
-    memset(bd, 0, 2 * sizeof(ALSBlockData));
1081
+    ALSBlockData bd[2] = { { 0 } };
1084 1082
 
1085 1083
     bd[0].ra_block         = ra_frame;
1086 1084
     bd[0].const_block      = ctx->const_block;
... ...
@@ -1346,7 +1342,7 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
1346 1346
                     sizeof(*ctx->raw_samples[c]) * sconf->max_order);
1347 1347
         }
1348 1348
     } else { // multi-channel coding
1349
-        ALSBlockData   bd;
1349
+        ALSBlockData   bd = { 0 };
1350 1350
         int            b;
1351 1351
         int            *reverted_channels = ctx->reverted_channels;
1352 1352
         unsigned int   offset             = 0;
... ...
@@ -1357,7 +1353,6 @@ static int read_frame_data(ALSDecContext *ctx, unsigned int ra_frame)
1357 1357
                 return -1;
1358 1358
             }
1359 1359
 
1360
-        memset(&bd,               0, sizeof(ALSBlockData));
1361 1360
         memset(reverted_channels, 0, sizeof(*reverted_channels) * avctx->channels);
1362 1361
 
1363 1362
         bd.ra_block         = ra_frame;
... ...
@@ -233,7 +233,7 @@ static void merge(GetBitContext *gb, uint8_t *dst, uint8_t *src, int size)
233 233
  */
234 234
 static void read_tree(GetBitContext *gb, Tree *tree)
235 235
 {
236
-    uint8_t tmp1[16], tmp2[16], *in = tmp1, *out = tmp2;
236
+    uint8_t tmp1[16] = { 0 }, tmp2[16], *in = tmp1, *out = tmp2;
237 237
     int i, t, len;
238 238
 
239 239
     tree->vlc_num = get_bits(gb, 4);
... ...
@@ -244,7 +244,6 @@ static void read_tree(GetBitContext *gb, Tree *tree)
244 244
     }
245 245
     if (get_bits1(gb)) {
246 246
         len = get_bits(gb, 3);
247
-        memset(tmp1, 0, sizeof(tmp1));
248 247
         for (i = 0; i <= len; i++) {
249 248
             tree->syms[i] = get_bits(gb, 4);
250 249
             tmp1[tree->syms[i]] = 1;
... ...
@@ -47,7 +47,7 @@ static void refill(CABACContext *c){
47 47
         c->low+= c->bytestream[0]<<1;
48 48
 #endif
49 49
     c->low -= CABAC_MASK;
50
-    c->bytestream+= CABAC_BITS/8;
50
+    c->bytestream += CABAC_BITS / 8;
51 51
 }
52 52
 
53 53
 static inline void renorm_cabac_decoder_once(CABACContext *c){
... ...
@@ -74,7 +74,7 @@ static void refill2(CABACContext *c){
74 74
 #endif
75 75
 
76 76
     c->low += x<<i;
77
-    c->bytestream+= CABAC_BITS/8;
77
+    c->bytestream += CABAC_BITS/8;
78 78
 }
79 79
 
80 80
 static av_always_inline int get_cabac_inline(CABACContext *c, uint8_t * const state){
... ...
@@ -411,10 +411,10 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
411 411
                        int *category, int *category_index)
412 412
 {
413 413
     int exp_idx, bias, tmpbias1, tmpbias2, bits_left, num_bits, index, v, i, j;
414
-    int exp_index2[102];
415
-    int exp_index1[102];
414
+    int exp_index2[102] = { 0 };
415
+    int exp_index1[102] = { 0 };
416 416
 
417
-    int tmp_categorize_array[128 * 2];
417
+    int tmp_categorize_array[128 * 2] = { 0 };
418 418
     int tmp_categorize_array1_idx = p->numvector_size;
419 419
     int tmp_categorize_array2_idx = p->numvector_size;
420 420
 
... ...
@@ -426,10 +426,6 @@ static void categorize(COOKContext *q, COOKSubpacket *p, const int *quant_index_
426 426
         //av_log(q->avctx, AV_LOG_ERROR, "bits_left = %d\n",bits_left);
427 427
     }
428 428
 
429
-    memset(&exp_index1,           0, sizeof(exp_index1));
430
-    memset(&exp_index2,           0, sizeof(exp_index2));
431
-    memset(&tmp_categorize_array, 0, sizeof(tmp_categorize_array));
432
-
433 429
     bias = -32;
434 430
 
435 431
     /* Estimate bias. */
... ...
@@ -649,14 +645,11 @@ static void decode_vectors(COOKContext *q, COOKSubpacket *p, int *category,
649 649
  */
650 650
 static int mono_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer)
651 651
 {
652
-    int category_index[128];
652
+    int category_index[128] = { 0 };
653
+    int category[128]       = { 0 };
653 654
     int quant_index_table[102];
654
-    int category[128];
655 655
     int res, i;
656 656
 
657
-    memset(&category,       0, sizeof(category));
658
-    memset(&category_index, 0, sizeof(category_index));
659
-
660 657
     if ((res = decode_envelope(q, p, quant_index_table)) < 0)
661 658
         return res;
662 659
     q->num_vectors = get_bits(&q->gb, p->log2_numvector_size);
... ...
@@ -829,13 +822,12 @@ static int joint_decode(COOKContext *q, COOKSubpacket *p, float *mlt_buffer1,
829 829
                         float *mlt_buffer2)
830 830
 {
831 831
     int i, j, res;
832
-    int decouple_tab[SUBBAND_SIZE];
832
+    int decouple_tab[SUBBAND_SIZE] = { 0 };
833 833
     float *decode_buffer = q->decode_buffer_0;
834 834
     int idx, cpl_tmp;
835 835
     float f1, f2;
836 836
     const float *cplscale;
837 837
 
838
-    memset(decouple_tab, 0, sizeof(decouple_tab));
839 838
     memset(decode_buffer, 0, sizeof(q->decode_buffer_0));
840 839
 
841 840
     /* Make sure the buffers are zeroed out. */
... ...
@@ -74,17 +74,11 @@ struct algo {
74 74
     int nonspec;
75 75
 };
76 76
 
77
-#ifndef FAAN_POSTSCALE
78
-#define FAAN_SCALE SCALE_PERM
79
-#else
80
-#define FAAN_SCALE NO_PERM
81
-#endif
82
-
83 77
 static int cpu_flags;
84 78
 
85 79
 static const struct algo fdct_tab[] = {
86 80
     { "REF-DBL",        ff_ref_fdct,           NO_PERM    },
87
-    { "FAAN",           ff_faandct,            FAAN_SCALE },
81
+    { "FAAN",           ff_faandct,            NO_PERM    },
88 82
     { "IJG-AAN-INT",    ff_fdct_ifast,         SCALE_PERM },
89 83
     { "IJG-LLM-INT",    ff_jpeg_fdct_islow_8,  NO_PERM    },
90 84
 
... ...
@@ -323,9 +323,11 @@ av_cold int ff_dvvideo_init(AVCodecContext *avctx)
323 323
 static av_cold int dvvideo_init_encoder(AVCodecContext *avctx)
324 324
 {
325 325
     if (!avpriv_dv_codec_profile(avctx)) {
326
-        av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video\n",
326
+        av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video. "
327
+               "Valid DV profiles are:\n",
327 328
                avctx->width, avctx->height, av_get_pix_fmt_name(avctx->pix_fmt));
328
-        return -1;
329
+        ff_dv_print_profiles(avctx, AV_LOG_ERROR);
330
+        return AVERROR(EINVAL);
329 331
     }
330 332
 
331 333
     return ff_dvvideo_init(avctx);
... ...
@@ -26,6 +26,7 @@
26 26
 
27 27
 #include "libavutil/rational.h"
28 28
 #include "libavutil/intreadwrite.h"
29
+#include "libavutil/pixdesc.h"
29 30
 #include "avcodec.h"
30 31
 #include "dvdata.h"
31 32
 
... ...
@@ -345,3 +346,14 @@ const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec)
345 345
 
346 346
     return NULL;
347 347
 }
348
+
349
+void ff_dv_print_profiles(void *logctx, int loglevel)
350
+{
351
+    int i;
352
+    for (i = 0; i < FF_ARRAY_ELEMS(dv_profiles); i++) {
353
+        const DVprofile *p = &dv_profiles[i];
354
+        av_log(logctx, loglevel, "Frame size: %dx%d; pixel format: %s, "
355
+               "framerate: %d/%d\n", p->width, p->height, av_get_pix_fmt_name(p->pix_fmt),
356
+               p->time_base.den, p->time_base.num);
357
+    }
358
+}
... ...
@@ -156,4 +156,9 @@ static inline void dv_calculate_mb_xy(DVVideoContext *s, DVwork_chunk *work_chun
156 156
      }
157 157
 }
158 158
 
159
+/**
160
+ *  Print all allowed DV profiles into logctx at specified logging level.
161
+ */
162
+void ff_dv_print_profiles(void *logctx, int loglevel);
163
+
159 164
 #endif /* AVCODEC_DVDATA_H */
... ...
@@ -43,7 +43,6 @@
43 43
 #include "simple_idct.h"
44 44
 #include "dvdata.h"
45 45
 #include "dvquant.h"
46
-#include "dv_tablegen.h"
47 46
 
48 47
 typedef struct BlockInfo {
49 48
     const uint32_t *factor_table;
... ...
@@ -135,7 +135,7 @@ static void guess_palette(uint32_t *rgba_palette,
135 135
         {0x00, 0x80, 0xff},
136 136
         {0x00, 0x55, 0xaa, 0xff},
137 137
     };
138
-    uint8_t color_used[16];
138
+    uint8_t color_used[16] = { 0 };
139 139
     int nb_opaque_colors, i, level, j, r, g, b;
140 140
     uint8_t *colormap = ctx->colormap, *alpha = ctx->alpha;
141 141
 
... ...
@@ -149,7 +149,6 @@ static void guess_palette(uint32_t *rgba_palette,
149 149
     for(i = 0; i < 4; i++)
150 150
         rgba_palette[i] = 0;
151 151
 
152
-    memset(color_used, 0, 16);
153 152
     nb_opaque_colors = 0;
154 153
     for(i = 0; i < 4; i++) {
155 154
         if (alpha[i] != 0 && !color_used[colormap[i]]) {
... ...
@@ -397,14 +396,13 @@ static int is_transp(const uint8_t *buf, int pitch, int n,
397 397
 /* return 0 if empty rectangle, 1 if non empty */
398 398
 static int find_smallest_bounding_rectangle(AVSubtitle *s)
399 399
 {
400
-    uint8_t transp_color[256];
400
+    uint8_t transp_color[256] = { 0 };
401 401
     int y1, y2, x1, x2, y, w, h, i;
402 402
     uint8_t *bitmap;
403 403
 
404 404
     if (s->num_rects == 0 || s->rects == NULL || s->rects[0]->w <= 0 || s->rects[0]->h <= 0)
405 405
         return 0;
406 406
 
407
-    memset(transp_color, 0, 256);
408 407
     for(i = 0; i < s->rects[0]->nb_colors; i++) {
409 408
         if ((((uint32_t*)s->rects[0]->pict.data[1])[i] >> 24) == 0)
410 409
             transp_color[i] = 1;
... ...
@@ -86,7 +86,7 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, MpegEncContext *s,
86 86
     struct dxva_context *ctx = avctx->hwaccel_context;
87 87
     unsigned               buffer_count = 0;
88 88
     DXVA2_DecodeBufferDesc buffer[4];
89
-    DXVA2_DecodeExecuteParams exec;
89
+    DXVA2_DecodeExecuteParams exec = { 0 };
90 90
     int      result;
91 91
 
92 92
     if (FAILED(IDirectXVideoDecoder_BeginFrame(ctx->decoder,
... ...
@@ -132,7 +132,6 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, MpegEncContext *s,
132 132
 
133 133
     assert(buffer_count == 1 + (qm_size > 0) + 2);
134 134
 
135
-    memset(&exec, 0, sizeof(exec));
136 135
     exec.NumCompBuffers      = buffer_count;
137 136
     exec.pCompressedBuffers  = buffer;
138 137
     exec.pExtensionData      = NULL;
... ...
@@ -29,11 +29,6 @@
29 29
 #include "faandct.h"
30 30
 
31 31
 #define FLOAT float
32
-#ifdef FAAN_POSTSCALE
33
-#    define SCALE(x) postscale[x]
34
-#else
35
-#    define SCALE(x) 1
36
-#endif
37 32
 
38 33
 //numbers generated by simple c code (not as accurate as they could be)
39 34
 /*
... ...
@@ -150,13 +145,13 @@ void ff_faandct(DCTELEM * data)
150 150
         tmp11= tmp1 + tmp2;
151 151
         tmp12= tmp1 - tmp2;
152 152
 
153
-        data[8*0 + i]= lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
154
-        data[8*4 + i]= lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
153
+        data[8*0 + i]= lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
154
+        data[8*4 + i]= lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
155 155
 
156 156
         tmp12 += tmp13;
157 157
         tmp12 *= A1;
158
-        data[8*2 + i]= lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
159
-        data[8*6 + i]= lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
158
+        data[8*2 + i]= lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
159
+        data[8*6 + i]= lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
160 160
 
161 161
         tmp4 += tmp5;
162 162
         tmp5 += tmp6;
... ...
@@ -175,10 +170,10 @@ void ff_faandct(DCTELEM * data)
175 175
         z11= tmp7 + tmp5;
176 176
         z13= tmp7 - tmp5;
177 177
 
178
-        data[8*5 + i]= lrintf(SCALE(8*5 + i) * (z13 + z2));
179
-        data[8*3 + i]= lrintf(SCALE(8*3 + i) * (z13 - z2));
180
-        data[8*1 + i]= lrintf(SCALE(8*1 + i) * (z11 + z4));
181
-        data[8*7 + i]= lrintf(SCALE(8*7 + i) * (z11 - z4));
178
+        data[8*5 + i]= lrintf(postscale[8*5 + i] * (z13 + z2));
179
+        data[8*3 + i]= lrintf(postscale[8*3 + i] * (z13 - z2));
180
+        data[8*1 + i]= lrintf(postscale[8*1 + i] * (z11 + z4));
181
+        data[8*7 + i]= lrintf(postscale[8*7 + i] * (z11 - z4));
182 182
     }
183 183
 }
184 184
 
... ...
@@ -208,25 +203,25 @@ void ff_faandct248(DCTELEM * data)
208 208
         tmp12 = tmp1 - tmp2;
209 209
         tmp13 = tmp0 - tmp3;
210 210
 
211
-        data[8*0 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
212
-        data[8*4 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
211
+        data[8*0 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
212
+        data[8*4 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
213 213
 
214 214
         tmp12 += tmp13;
215 215
         tmp12 *= A1;
216
-        data[8*2 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
217
-        data[8*6 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
216
+        data[8*2 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
217
+        data[8*6 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
218 218
 
219 219
         tmp10 = tmp4 + tmp7;
220 220
         tmp11 = tmp5 + tmp6;
221 221
         tmp12 = tmp5 - tmp6;
222 222
         tmp13 = tmp4 - tmp7;
223 223
 
224
-        data[8*1 + i] = lrintf(SCALE(8*0 + i) * (tmp10 + tmp11));
225
-        data[8*5 + i] = lrintf(SCALE(8*4 + i) * (tmp10 - tmp11));
224
+        data[8*1 + i] = lrintf(postscale[8*0 + i] * (tmp10 + tmp11));
225
+        data[8*5 + i] = lrintf(postscale[8*4 + i] * (tmp10 - tmp11));
226 226
 
227 227
         tmp12 += tmp13;
228 228
         tmp12 *= A1;
229
-        data[8*3 + i] = lrintf(SCALE(8*2 + i) * (tmp13 + tmp12));
230
-        data[8*7 + i] = lrintf(SCALE(8*6 + i) * (tmp13 - tmp12));
229
+        data[8*3 + i] = lrintf(postscale[8*2 + i] * (tmp13 + tmp12));
230
+        data[8*7 + i] = lrintf(postscale[8*6 + i] * (tmp13 - tmp12));
231 231
     }
232 232
 }
... ...
@@ -31,8 +31,6 @@
31 31
 
32 32
 #include "dsputil.h"
33 33
 
34
-#define FAAN_POSTSCALE
35
-
36 34
 void ff_faandct(DCTELEM * data);
37 35
 void ff_faandct248(DCTELEM * data);
38 36
 
... ...
@@ -573,8 +573,7 @@ static int flac_parse(AVCodecParserContext *s, AVCodecContext *avctx,
573 573
             av_fifo_generic_write(fpc->fifo_buf, (void*) read_start,
574 574
                                   read_end - read_start, NULL);
575 575
         } else {
576
-            int8_t pad[MAX_FRAME_HEADER_SIZE];
577
-            memset(pad, 0, sizeof(pad));
576
+            int8_t pad[MAX_FRAME_HEADER_SIZE] = { 0 };
578 577
             av_fifo_generic_write(fpc->fifo_buf, (void*) pad, sizeof(pad), NULL);
579 578
         }
580 579
 
... ...
@@ -152,10 +152,8 @@ static void spatial_compensation_0(uint8_t *src , uint8_t *dst, int linesize){
152 152
     int x,y;
153 153
     unsigned int p;//power divided by 2
154 154
     int a;
155
-    uint16_t left_sum[2][8];
156
-    uint16_t  top_sum[2][8];
157
-    memset(left_sum,0,2*8*sizeof(uint16_t));
158
-    memset( top_sum,0,2*8*sizeof(uint16_t));
155
+    uint16_t left_sum[2][8] = { { 0 } };
156
+    uint16_t  top_sum[2][8] = { { 0 } };
159 157
 
160 158
     for(i=0;i<8;i++){
161 159
         a=src[area2+7-i]<<4;
... ...
@@ -210,8 +210,7 @@ static inline void ls_encode_line(JLSState *state, PutBitContext *pb, void *last
210 210
 
211 211
 static void ls_store_lse(JLSState *state, PutBitContext *pb){
212 212
     /* Test if we have default params and don't need to store LSE */
213
-    JLSState state2;
214
-    memset(&state2, 0, sizeof(JLSState));
213
+    JLSState state2 = { 0 };
215 214
     state2.bpp = state->bpp;
216 215
     state2.near = state->near;
217 216
     ff_jpegls_reset_coding_parameters(&state2, 1);
... ...
@@ -251,21 +251,22 @@ static void lag_pred_line(LagarithContext *l, uint8_t *buf,
251 251
         /* Left prediction only for first line */
252 252
         L = l->dsp.add_hfyu_left_prediction(buf + 1, buf + 1,
253 253
                                             width - 1, buf[0]);
254
-        return;
255
-    }
256
-    /* Left pixel is actually prev_row[width] */
257
-    L = buf[width - stride - 1];
258
-    if (line == 1) {
259
-        /* Second line, left predict first pixel, the rest of the line is median predicted
260
-         * NOTE: In the case of RGB this pixel is top predicted */
261
-        TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;
262 254
     } else {
263
-        /* Top left is 2 rows back, last pixel */
264
-        TL = buf[width - (2 * stride) - 1];
265
-    }
255
+        /* Left pixel is actually prev_row[width] */
256
+        L = buf[width - stride - 1];
257
+
258
+        if (line == 1) {
259
+            /* Second line, left predict first pixel, the rest of the line is median predicted
260
+             * NOTE: In the case of RGB this pixel is top predicted */
261
+            TL = l->avctx->pix_fmt == PIX_FMT_YUV420P ? buf[-stride] : L;
262
+        } else {
263
+            /* Top left is 2 rows back, last pixel */
264
+            TL = buf[width - (2 * stride) - 1];
265
+        }
266 266
 
267
-    add_lag_median_prediction(buf, buf - stride, buf,
268
-                              width, &L, &TL);
267
+        add_lag_median_prediction(buf, buf - stride, buf,
268
+                                  width, &L, &TL);
269
+    }
269 270
 }
270 271
 
271 272
 static int lag_decode_line(LagarithContext *l, lag_rac *rac,
... ...
@@ -311,13 +312,13 @@ handle_zeros:
311 311
 }
312 312
 
313 313
 static int lag_decode_zero_run_line(LagarithContext *l, uint8_t *dst,
314
-                                    const uint8_t *src, const uint8_t *srcend, int width,
315
-                                    int esc_count)
314
+                                    const uint8_t *src, const uint8_t *src_end,
315
+                                    int width, int esc_count)
316 316
 {
317 317
     int i = 0;
318 318
     int count;
319 319
     uint8_t zero_run = 0;
320
-    const uint8_t *start = src;
320
+    const uint8_t *src_start = src;
321 321
     uint8_t mask1 = -(esc_count < 2);
322 322
     uint8_t mask2 = -(esc_count < 3);
323 323
     uint8_t *end = dst + (width - 2);
... ...
@@ -334,8 +335,8 @@ output_zeros:
334 334
         i = 0;
335 335
         while (!zero_run && dst + i < end) {
336 336
             i++;
337
-            if (i+2 >= srcend - src)
338
-                return src - start;
337
+            if (i+2 >= src_end - src)
338
+                return AVERROR_INVALIDDATA;
339 339
             zero_run =
340 340
                 !(src[i] | (src[i + 1] & mask1) | (src[i + 2] & mask2));
341 341
         }
... ...
@@ -351,9 +352,10 @@ output_zeros:
351 351
         } else {
352 352
             memcpy(dst, src, i);
353 353
             src += i;
354
+            dst += i;
354 355
         }
355 356
     }
356
-    return  src - start;
357
+    return  src - src_start;
357 358
 }
358 359
 
359 360
 
... ...
@@ -369,7 +371,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
369 369
     int esc_count;
370 370
     GetBitContext gb;
371 371
     lag_rac rac;
372
-    const uint8_t *srcend = src + src_size;
372
+    const uint8_t *src_end = src + src_size;
373 373
 
374 374
     rac.avctx = l->avctx;
375 375
     l->zeros = 0;
... ...
@@ -406,12 +408,16 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
406 406
         esc_count -= 4;
407 407
         if (esc_count > 0) {
408 408
             /* Zero run coding only, no range coding. */
409
-            for (i = 0; i < height; i++)
410
-                src += lag_decode_zero_run_line(l, dst + (i * stride), src, srcend,
411
-                                                width, esc_count);
409
+            for (i = 0; i < height; i++) {
410
+                int res = lag_decode_zero_run_line(l, dst + (i * stride), src,
411
+                                                   src_end, width, esc_count);
412
+                if (res < 0)
413
+                    return res;
414
+                src += res;
415
+            }
412 416
         } else {
413
-            if (src_size < height * width)
414
-                return -1;
417
+            if (src_size < width * height)
418
+                return AVERROR_INVALIDDATA; // buffer not big enough
415 419
             /* Plane is stored uncompressed */
416 420
             for (i = 0; i < height; i++) {
417 421
                 memcpy(dst + (i * stride), src, width);
... ...
@@ -518,15 +524,18 @@ static int lag_decode_frame(AVCodecContext *avctx,
518 518
         }
519 519
         for (i = 0; i < planes; i++)
520 520
             srcs[i] = l->rgb_planes + (i + 1) * l->rgb_stride * avctx->height - l->rgb_stride;
521
-        for (i = 0; i < planes; i++) {
521
+        for (i = 0; i < planes; i++)
522 522
             if (buf_size <= offs[i]) {
523
+                av_log(avctx, AV_LOG_ERROR,
524
+                        "Invalid frame offsets\n");
523 525
                 return AVERROR_INVALIDDATA;
524 526
             }
527
+
528
+        for (i = 0; i < planes; i++)
525 529
             lag_decode_arith_plane(l, srcs[i],
526 530
                                    avctx->width, avctx->height,
527 531
                                    -l->rgb_stride, buf + offs[i],
528 532
                                    buf_size - offs[i]);
529
-        }
530 533
         dst = p->data[0];
531 534
         for (i = 0; i < planes; i++)
532 535
             srcs[i] = l->rgb_planes + i * l->rgb_stride * avctx->height;
... ...
@@ -563,6 +572,14 @@ static int lag_decode_frame(AVCodecContext *avctx,
563 563
             return AVERROR_INVALIDDATA;
564 564
         }
565 565
 
566
+        if (offset_ry >= buf_size ||
567
+            offset_gu >= buf_size ||
568
+            offset_bv >= buf_size) {
569
+            av_log(avctx, AV_LOG_ERROR,
570
+                   "Invalid frame offsets\n");
571
+            return AVERROR_INVALIDDATA;
572
+        }
573
+
566 574
         lag_decode_arith_plane(l, p->data[0], avctx->width, avctx->height,
567 575
                                p->linesize[0], buf + offset_ry,
568 576
                                buf_size - offset_ry);
... ...
@@ -32,15 +32,17 @@
32 32
 
33 33
 void ff_lag_rac_init(lag_rac *l, GetBitContext *gb, int length)
34 34
 {
35
-    int i, j;
35
+    int i, j, left;
36 36
 
37 37
     /* According to reference decoder "1st byte is garbage",
38 38
      * however, it gets skipped by the call to align_get_bits()
39 39
      */
40 40
     align_get_bits(gb);
41
+    left                = get_bits_left(gb) >> 3;
41 42
     l->bytestream_start =
42 43
     l->bytestream       = gb->buffer + get_bits_count(gb) / 8;
43
-    l->bytestream_end   = l->bytestream_start + get_bits_left(gb) / 8;
44
+    l->bytestream_end   = l->bytestream_start + left;
45
+
44 46
     l->range        = 0x80;
45 47
     l->low          = *l->bytestream >> 1;
46 48
     l->hash_shift   = FFMAX(l->scale - 8, 0);
... ...
@@ -36,8 +36,8 @@ extern unsigned int xvid_debug;
36 36
 int ff_xvid_rate_control_init(MpegEncContext *s){
37 37
     char *tmp_name;
38 38
     int fd, i;
39
-    xvid_plg_create_t xvid_plg_create;
40
-    xvid_plugin_2pass2_t xvid_2pass2;
39
+    xvid_plg_create_t xvid_plg_create = { 0 };
40
+    xvid_plugin_2pass2_t xvid_2pass2  = { 0 };
41 41
 
42 42
 //xvid_debug=-1;
43 43
 
... ...
@@ -67,7 +67,6 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
67 67
 
68 68
     close(fd);
69 69
 
70
-    memset(&xvid_2pass2, 0, sizeof(xvid_2pass2));
71 70
     xvid_2pass2.version= XVID_MAKE_VERSION(1,1,0);
72 71
     xvid_2pass2.filename= tmp_name;
73 72
     xvid_2pass2.bitrate= s->avctx->bit_rate;
... ...
@@ -75,7 +74,6 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
75 75
     xvid_2pass2.vbv_maxrate= s->avctx->rc_max_rate;
76 76
     xvid_2pass2.vbv_initial= s->avctx->rc_initial_buffer_occupancy;
77 77
 
78
-    memset(&xvid_plg_create, 0, sizeof(xvid_plg_create));
79 78
     xvid_plg_create.version= XVID_MAKE_VERSION(1,1,0);
80 79
     xvid_plg_create.fbase= s->avctx->time_base.den;
81 80
     xvid_plg_create.fincr= s->avctx->time_base.num;
... ...
@@ -89,9 +87,8 @@ int ff_xvid_rate_control_init(MpegEncContext *s){
89 89
 }
90 90
 
91 91
 float ff_xvid_rate_estimate_qscale(MpegEncContext *s, int dry_run){
92
-    xvid_plg_data_t xvid_plg_data;
92
+    xvid_plg_data_t xvid_plg_data = { 0 };
93 93
 
94
-    memset(&xvid_plg_data, 0, sizeof(xvid_plg_data));
95 94
     xvid_plg_data.version= XVID_MAKE_VERSION(1,1,0);
96 95
     xvid_plg_data.width = s->width;
97 96
     xvid_plg_data.height= s->height;
... ...
@@ -94,11 +94,11 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
94 94
     uint16_t *intra, *inter;
95 95
     int fd;
96 96
 
97
-    xvid_plugin_single_t single;
98
-    struct xvid_ff_pass1 rc2pass1;
99
-    xvid_plugin_2pass2_t rc2pass2;
100
-    xvid_gbl_init_t xvid_gbl_init;
101
-    xvid_enc_create_t xvid_enc_create;
97
+    xvid_plugin_single_t single       = { 0 };
98
+    struct xvid_ff_pass1 rc2pass1     = { 0 };
99
+    xvid_plugin_2pass2_t rc2pass2     = { 0 };
100
+    xvid_gbl_init_t xvid_gbl_init     = { 0 };
101
+    xvid_enc_create_t xvid_enc_create = { 0 };
102 102
     xvid_enc_plugin_t plugins[7];
103 103
 
104 104
     /* Bring in VOP flags from ffmpeg command-line */
... ...
@@ -168,7 +168,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
168 168
             x->me_flags |= XVID_ME_QUARTERPELREFINE8;
169 169
     }
170 170
 
171
-    memset(&xvid_gbl_init, 0, sizeof(xvid_gbl_init));
172 171
     xvid_gbl_init.version = XVID_VERSION;
173 172
     xvid_gbl_init.debug = 0;
174 173
 
... ...
@@ -189,7 +188,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
189 189
     xvid_global(NULL, XVID_GBL_INIT, &xvid_gbl_init, NULL);
190 190
 
191 191
     /* Create the encoder reference */
192
-    memset(&xvid_enc_create, 0, sizeof(xvid_enc_create));
193 192
     xvid_enc_create.version = XVID_VERSION;
194 193
 
195 194
     /* Store the desired frame size */
... ...
@@ -214,7 +212,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
214 214
     x->twopassfile = NULL;
215 215
 
216 216
     if( xvid_flags & CODEC_FLAG_PASS1 ) {
217
-        memset(&rc2pass1, 0, sizeof(struct xvid_ff_pass1));
218 217
         rc2pass1.version = XVID_VERSION;
219 218
         rc2pass1.context = x;
220 219
         x->twopassbuffer = av_malloc(BUFFER_SIZE);
... ...
@@ -230,7 +227,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
230 230
         plugins[xvid_enc_create.num_plugins].param = &rc2pass1;
231 231
         xvid_enc_create.num_plugins++;
232 232
     } else if( xvid_flags & CODEC_FLAG_PASS2 ) {
233
-        memset(&rc2pass2, 0, sizeof(xvid_plugin_2pass2_t));
234 233
         rc2pass2.version = XVID_VERSION;
235 234
         rc2pass2.bitrate = avctx->bit_rate;
236 235
 
... ...
@@ -262,7 +258,6 @@ static av_cold int xvid_encode_init(AVCodecContext *avctx)  {
262 262
         xvid_enc_create.num_plugins++;
263 263
     } else if( !(xvid_flags & CODEC_FLAG_QSCALE) ) {
264 264
         /* Single Pass Bitrate Control! */
265
-        memset(&single, 0, sizeof(xvid_plugin_single_t));
266 265
         single.version = XVID_VERSION;
267 266
         single.bitrate = avctx->bit_rate;
268 267
 
... ...
@@ -382,16 +377,14 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
382 382
     int mb_width   = (avctx->width  + 15) / 16;
383 383
     int mb_height  = (avctx->height + 15) / 16;
384 384
 
385
-    xvid_enc_frame_t xvid_enc_frame;
386
-    xvid_enc_stats_t xvid_enc_stats;
385
+    xvid_enc_frame_t xvid_enc_frame = { 0 };
386
+    xvid_enc_stats_t xvid_enc_stats = { 0 };
387 387
 
388 388
     if ((ret = ff_alloc_packet2(avctx, pkt, mb_width*mb_height*MAX_MB_BYTES + FF_MIN_BUFFER_SIZE)) < 0)
389 389
         return ret;
390 390
 
391 391
     /* Start setting up the frame */
392
-    memset(&xvid_enc_frame, 0, sizeof(xvid_enc_frame));
393 392
     xvid_enc_frame.version = XVID_VERSION;
394
-    memset(&xvid_enc_stats, 0, sizeof(xvid_enc_stats));
395 393
     xvid_enc_stats.version = XVID_VERSION;
396 394
     *p = *picture;
397 395
 
... ...
@@ -47,14 +47,13 @@ static int build_vlc(VLC *vlc, const uint8_t *bits_table,
47 47
                      const uint8_t *val_table, int nb_codes,
48 48
                      int use_static, int is_ac)
49 49
 {
50
-    uint8_t huff_size[256];
50
+    uint8_t huff_size[256] = { 0 };
51 51
     uint16_t huff_code[256];
52 52
     uint16_t huff_sym[256];
53 53
     int i;
54 54
 
55 55
     assert(nb_codes <= 256);
56 56
 
57
-    memset(huff_size, 0, sizeof(huff_size));
58 57
     ff_mjpeg_build_huffman_codes(huff_size, huff_code, bits_table, val_table);
59 58
 
60 59
     for (i = 0; i < 256; i++)
... ...
@@ -1435,9 +1435,8 @@ static inline int bidir_refine(MpegEncContext * s, int mb_x, int mb_y)
1435 1435
 #define HASH(fx,fy,bx,by) ((fx)+17*(fy)+63*(bx)+117*(by))
1436 1436
 #define HASH8(fx,fy,bx,by) ((uint8_t)HASH(fx,fy,bx,by))
1437 1437
     int hashidx= HASH(motion_fx,motion_fy, motion_bx, motion_by);
1438
-    uint8_t map[256];
1438
+    uint8_t map[256] = { 0 };
1439 1439
 
1440
-    memset(map,0,sizeof(map));
1441 1440
     map[hashidx&255] = 1;
1442 1441
 
1443 1442
     fbmin= check_bidir_mv(s, motion_fx, motion_fy,
... ...
@@ -304,11 +304,8 @@ static av_cold void decode_init_static(void)
304 304
     for (i = 1; i < 16; i++) {
305 305
         const HuffTable *h = &mpa_huff_tables[i];
306 306
         int xsize, x, y;
307
-        uint8_t  tmp_bits [512];
308
-        uint16_t tmp_codes[512];
309
-
310
-        memset(tmp_bits , 0, sizeof(tmp_bits ));
311
-        memset(tmp_codes, 0, sizeof(tmp_codes));
307
+        uint8_t  tmp_bits [512] = { 0 };
308
+        uint16_t tmp_codes[512] = { 0 };
312 309
 
313 310
         xsize = h->xsize;
314 311
 
... ...
@@ -80,11 +80,8 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
80 80
     for (qscale = qmin; qscale <= qmax; qscale++) {
81 81
         int i;
82 82
         if (dsp->fdct == ff_jpeg_fdct_islow_8 ||
83
-            dsp->fdct == ff_jpeg_fdct_islow_10
84
-#ifdef FAAN_POSTSCALE
85
-            || dsp->fdct == ff_faandct
86
-#endif
87
-            ) {
83
+            dsp->fdct == ff_jpeg_fdct_islow_10 ||
84
+            dsp->fdct == ff_faandct) {
88 85
             for (i = 0; i < 64; i++) {
89 86
                 const int j = dsp->idct_permutation[i];
90 87
                 /* 16 <= qscale * quant_matrix[i] <= 7905
... ...
@@ -96,11 +93,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
96 96
                 qmat[qscale][i] = (int)((UINT64_C(1) << QMAT_SHIFT) /
97 97
                                         (qscale * quant_matrix[j]));
98 98
             }
99
-        } else if (dsp->fdct == ff_fdct_ifast
100
-#ifndef FAAN_POSTSCALE
101
-                   || dsp->fdct == ff_faandct
102
-#endif
103
-                   ) {
99
+        } else if (dsp->fdct == ff_fdct_ifast) {
104 100
             for (i = 0; i < 64; i++) {
105 101
                 const int j = dsp->idct_permutation[i];
106 102
                 /* 16 <= qscale * quant_matrix[i] <= 7905
... ...
@@ -138,11 +131,7 @@ void ff_convert_matrix(DSPContext *dsp, int (*qmat)[64],
138 138
 
139 139
         for (i = intra; i < 64; i++) {
140 140
             int64_t max = 8191;
141
-            if (dsp->fdct == ff_fdct_ifast
142
-#ifndef FAAN_POSTSCALE
143
-                || dsp->fdct == ff_faandct
144
-#endif
145
-               ) {
141
+            if (dsp->fdct == ff_fdct_ifast) {
146 142
                 max = (8191LL * ff_aanscales[i]) >> 14;
147 143
             }
148 144
             while (((max * qmat[qscale][i]) >> shift) > INT_MAX) {
... ...
@@ -3516,11 +3505,7 @@ static int dct_quantize_trellis_c(MpegEncContext *s,
3516 3516
         int dct_coeff= FFABS(block[ scantable[i] ]);
3517 3517
         int best_score=256*256*256*120;
3518 3518
 
3519
-        if (   s->dsp.fdct == ff_fdct_ifast
3520
-#ifndef FAAN_POSTSCALE
3521
-            || s->dsp.fdct == ff_faandct
3522
-#endif
3523
-           )
3519
+        if (s->dsp.fdct == ff_fdct_ifast)
3524 3520
             dct_coeff= (dct_coeff*ff_inv_aanscales[ scantable[i] ]) >> 12;
3525 3521
         zero_distortion= dct_coeff*dct_coeff;
3526 3522
 
... ...
@@ -342,7 +342,7 @@ static void ra144_encode_subblock(RA144Context *ractx,
342 342
                                   const int16_t *lpc_coefs, unsigned int rms,
343 343
                                   PutBitContext *pb)
344 344
 {
345
-    float data[BLOCKSIZE], work[LPC_ORDER + BLOCKSIZE];
345
+    float data[BLOCKSIZE] = { 0 }, work[LPC_ORDER + BLOCKSIZE];
346 346
     float coefs[LPC_ORDER];
347 347
     float zero[BLOCKSIZE], cba[BLOCKSIZE], cb1[BLOCKSIZE], cb2[BLOCKSIZE];
348 348
     int16_t cba_vect[BLOCKSIZE];
... ...
@@ -360,7 +360,6 @@ static void ra144_encode_subblock(RA144Context *ractx,
360 360
      * Calculate the zero-input response of the LPC filter and subtract it from
361 361
      * input data.
362 362
      */
363
-    memset(data, 0, sizeof(data));
364 363
     ff_celp_lp_synthesis_filterf(work + LPC_ORDER, coefs, data, BLOCKSIZE,
365 364
                                  LPC_ORDER);
366 365
     for (i = 0; i < BLOCKSIZE; i++) {
... ...
@@ -119,7 +119,7 @@ int main(void){
119 119
     uint8_t b[9*SIZE];
120 120
     uint8_t r[9*SIZE];
121 121
     int i;
122
-    uint8_t state[10]= {0};
122
+    uint8_t state[10];
123 123
     AVLFG prng;
124 124
 
125 125
     av_lfg_init(&prng, 1);
... ...
@@ -554,7 +554,7 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir)
554 554
     MpegEncContext *s = &r->s;
555 555
     int mb_pos = s->mb_x + s->mb_y * s->mb_stride;
556 556
     int mv_pos = s->mb_x * 2 + s->mb_y * 2 * s->b8_stride;
557
-    int A[2], B[2], C[2];
557
+    int A[2] = { 0 }, B[2] = { 0 }, C[2] = { 0 };
558 558
     int has_A = 0, has_B = 0, has_C = 0;
559 559
     int mx, my;
560 560
     int i, j;
... ...
@@ -562,9 +562,6 @@ static void rv34_pred_mv_b(RV34DecContext *r, int block_type, int dir)
562 562
     const int mask = dir ? MB_TYPE_L1 : MB_TYPE_L0;
563 563
     int type = cur_pic->f.mb_type[mb_pos];
564 564
 
565
-    memset(A, 0, sizeof(A));
566
-    memset(B, 0, sizeof(B));
567
-    memset(C, 0, sizeof(C));
568 565
     if((r->avail_cache[6-1] & type) & mask){
569 566
         A[0] = cur_pic->f.motion_val[dir][mv_pos - 1][0];
570 567
         A[1] = cur_pic->f.motion_val[dir][mv_pos - 1][1];
... ...
@@ -180,7 +180,7 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
180 180
     int res;
181 181
     HuffContext huff;
182 182
     HuffContext tmp1, tmp2;
183
-    VLC vlc[2];
183
+    VLC vlc[2] = { { 0 } };
184 184
     int escapes[3];
185 185
     DBCtx ctx;
186 186
     int err = 0;
... ...
@@ -204,9 +204,6 @@ static int smacker_decode_header_tree(SmackVContext *smk, GetBitContext *gb, int
204 204
     tmp2.lengths = av_mallocz(256 * sizeof(int));
205 205
     tmp2.values = av_mallocz(256 * sizeof(int));
206 206
 
207
-    memset(&vlc[0], 0, sizeof(VLC));
208
-    memset(&vlc[1], 0, sizeof(VLC));
209
-
210 207
     if(get_bits1(gb)) {
211 208
         smacker_decode_tree(gb, &tmp1, 0, 0);
212 209
         skip_bits1(gb);
... ...
@@ -597,8 +594,8 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
597 597
     const uint8_t *buf = avpkt->data;
598 598
     int buf_size = avpkt->size;
599 599
     GetBitContext gb;
600
-    HuffContext h[4];
601
-    VLC vlc[4];
600
+    HuffContext h[4] = { { 0 } };
601
+    VLC vlc[4]       = { { 0 } };
602 602
     int16_t *samples;
603 603
     uint8_t *samples8;
604 604
     int val;
... ...
@@ -641,8 +638,6 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
641 641
     samples  = (int16_t *)s->frame.data[0];
642 642
     samples8 =            s->frame.data[0];
643 643
 
644
-    memset(vlc, 0, sizeof(VLC) * 4);
645
-    memset(h, 0, sizeof(HuffContext) * 4);
646 644
     // Initialize
647 645
     for(i = 0; i < (1 << (bits + stereo)); i++) {
648 646
         h[i].length = 256;
... ...
@@ -82,10 +82,9 @@ static unsigned tget(const uint8_t **p, int type, int le) {
82 82
 #if CONFIG_ZLIB
83 83
 static int tiff_uncompress(uint8_t *dst, unsigned long *len, const uint8_t *src, int size)
84 84
 {
85
-    z_stream zstream;
85
+    z_stream zstream = { 0 };
86 86
     int zret;
87 87
 
88
-    memset(&zstream, 0, sizeof(zstream));
89 88
     zstream.next_in = src;
90 89
     zstream.avail_in = size;
91 90
     zstream.next_out = dst;
... ...
@@ -310,7 +310,7 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
310 310
     int width_shift = 0;
311 311
     int new_pix_fmt;
312 312
     struct frame_header header;
313
-    uint8_t header_buffer[128];  /* logical maximum size of the header */
313
+    uint8_t header_buffer[128] = { 0 };  /* logical maximum size of the header */
314 314
     const uint8_t *sel_vector_table;
315 315
 
316 316
     header.header_size = ((s->buf[0] >> 5) | (s->buf[0] << 3)) & 0x7f;
... ...
@@ -321,7 +321,6 @@ static int truemotion1_decode_header(TrueMotion1Context *s)
321 321
     }
322 322
 
323 323
     /* unscramble the header bytes with a XOR operation */
324
-    memset(header_buffer, 0, 128);
325 324
     for (i = 1; i < header.header_size; i++)
326 325
         header_buffer[i - 1] = s->buf[i] ^ s->buf[i + 1];
327 326
 
... ...
@@ -903,6 +903,7 @@ static int decode_subframe(WmallDecodeCtx *s)
903 903
     } else if (!s->cdlms[0][0].order) {
904 904
         av_log(s->avctx, AV_LOG_DEBUG,
905 905
                "Waiting for seekable tile\n");
906
+        s->frame.nb_samples = 0;
906 907
         return -1;
907 908
     }
908 909
 
... ...
@@ -1265,6 +1266,17 @@ static int decode_packet(AVCodecContext *avctx, void *data, int *got_frame_ptr,
1265 1265
     return (s->packet_loss) ? AVERROR_INVALIDDATA : get_bits_count(gb) >> 3;
1266 1266
 }
1267 1267
 
1268
+static void flush(AVCodecContext *avctx)
1269
+{
1270
+    WmallDecodeCtx *s    = avctx->priv_data;
1271
+    s->packet_loss       = 1;
1272
+    s->packet_done       = 0;
1273
+    s->num_saved_bits    = 0;
1274
+    s->frame_offset      = 0;
1275
+    s->next_packet_start = 0;
1276
+    s->cdlms[0][0].order = 0;
1277
+    s->frame.nb_samples  = 0;
1278
+}
1268 1279
 
1269 1280
 AVCodec ff_wmalossless_decoder = {
1270 1281
     .name           = "wmalossless",
... ...
@@ -1273,6 +1285,7 @@ AVCodec ff_wmalossless_decoder = {
1273 1273
     .priv_data_size = sizeof(WmallDecodeCtx),
1274 1274
     .init           = decode_init,
1275 1275
     .decode         = decode_packet,
1276
+    .flush          = flush,
1276 1277
     .capabilities   = CODEC_CAP_SUBFRAMES | CODEC_CAP_DR1 | CODEC_CAP_DELAY,
1277 1278
     .long_name      = NULL_IF_CONFIG_SMALL("Windows Media Audio Lossless"),
1278 1279
 };
... ...
@@ -521,7 +521,7 @@ static int decode_subframe_length(WMAProDecodeCtx *s, int offset)
521 521
  */
522 522
 static int decode_tilehdr(WMAProDecodeCtx *s)
523 523
 {
524
-    uint16_t num_samples[WMAPRO_MAX_CHANNELS];        /**< sum of samples for all currently known subframes of a channel */
524
+    uint16_t num_samples[WMAPRO_MAX_CHANNELS] = { 0 };/**< sum of samples for all currently known subframes of a channel */
525 525
     uint8_t  contains_subframe[WMAPRO_MAX_CHANNELS];  /**< flag indicating if a channel contains the current subframe */
526 526
     int channels_for_cur_subframe = s->num_channels;  /**< number of channels that contain the current subframe */
527 527
     int fixed_channel_layout = 0;                     /**< flag indicating that all channels use the same subframe offsets and sizes */
... ...
@@ -538,8 +538,6 @@ static int decode_tilehdr(WMAProDecodeCtx *s)
538 538
     for (c = 0; c < s->num_channels; c++)
539 539
         s->channel[c].num_subframes = 0;
540 540
 
541
-    memset(num_samples, 0, sizeof(num_samples));
542
-
543 541
     if (s->max_num_subframes == 1 || get_bits1(&s->gb))
544 542
         fixed_channel_layout = 1;
545 543
 
... ...
@@ -318,10 +318,9 @@ static av_cold int decode_vbmtree(GetBitContext *gb, int8_t vbm_tree[25])
318 318
           0x0ffc, 0x0ffd, 0x0ffe,        //   1111111111+00/01/10
319 319
           0x3ffc, 0x3ffd, 0x3ffe, 0x3fff // 111111111111+xx
320 320
     };
321
-    int cntr[8], n, res;
321
+    int cntr[8] = { 0 }, n, res;
322 322
 
323 323
     memset(vbm_tree, 0xff, sizeof(vbm_tree[0]) * 25);
324
-    memset(cntr,     0,    sizeof(cntr));
325 324
     for (n = 0; n < 17; n++) {
326 325
         res = get_bits(gb, 3);
327 326
         if (cntr[res] > 3) // should be >= 3 + (res == 7))
... ...
@@ -27,7 +27,7 @@
27 27
 #include "config.h"
28 28
 
29 29
 #if HAVE_FAST_CMOV
30
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
30
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, range, tmp)\
31 31
         "mov    "tmp"       , %%ecx     \n\t"\
32 32
         "shl    $17         , "tmp"     \n\t"\
33 33
         "cmp    "low"       , "tmp"     \n\t"\
... ...
@@ -37,7 +37,7 @@
37 37
         "xor    %%ecx       , "ret"     \n\t"\
38 38
         "sub    "tmp"       , "low"     \n\t"
39 39
 #else /* HAVE_FAST_CMOV */
40
-#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)\
40
+#define BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, range, tmp)\
41 41
         "mov    "tmp"       , %%ecx     \n\t"\
42 42
         "shl    $17         , "tmp"     \n\t"\
43 43
         "sub    "low"       , "tmp"     \n\t"\
... ...
@@ -51,20 +51,20 @@
51 51
         "xor    "tmp"       , "ret"     \n\t"
52 52
 #endif /* HAVE_FAST_CMOV */
53 53
 
54
-#define BRANCHLESS_GET_CABAC(ret, statep, low, lowword, range, tmp, tmpbyte, byte) \
54
+#define BRANCHLESS_GET_CABAC(ret, statep, low, lowword, range, tmp, tmpbyte, byte, end) \
55 55
         "movzbl "statep"    , "ret"                                     \n\t"\
56 56
         "mov    "range"     , "tmp"                                     \n\t"\
57 57
         "and    $0xC0       , "range"                                   \n\t"\
58 58
         "movzbl "MANGLE(ff_h264_lps_range)"("ret", "range", 2), "range" \n\t"\
59 59
         "sub    "range"     , "tmp"                                     \n\t"\
60
-        BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, lowword, range, tmp)   \
60
+        BRANCHLESS_GET_CABAC_UPDATE(ret, statep, low, range, tmp)   \
61 61
         "movzbl " MANGLE(ff_h264_norm_shift) "("range"), %%ecx          \n\t"\
62 62
         "shl    %%cl        , "range"                                   \n\t"\
63 63
         "movzbl "MANGLE(ff_h264_mlps_state)"+128("ret"), "tmp"          \n\t"\
64 64
         "shl    %%cl        , "low"                                     \n\t"\
65 65
         "mov    "tmpbyte"   , "statep"                                  \n\t"\
66 66
         "test   "lowword"   , "lowword"                                 \n\t"\
67
-        " jnz   1f                                                      \n\t"\
67
+        " jnz   2f                                                      \n\t"\
68 68
         "mov    "byte"      , %%"REG_c"                                 \n\t"\
69 69
         "add"OPSIZE" $2     , "byte"                                    \n\t"\
70 70
         "movzwl (%%"REG_c")     , "tmp"                                 \n\t"\
... ...
@@ -79,7 +79,7 @@
79 79
         "add    $7          , %%ecx                                     \n\t"\
80 80
         "shl    %%cl        , "tmp"                                     \n\t"\
81 81
         "add    "tmp"       , "low"                                     \n\t"\
82
-        "1:                                                             \n\t"
82
+        "2:                                                             \n\t"
83 83
 
84 84
 
85 85
 #if HAVE_7REGS && !defined(BROKEN_RELOCATIONS) && !(defined(__i386) && defined(__clang__) && (__clang_major__<2 || (__clang_major__==2 && __clang_minor__<10)))\
... ...
@@ -91,11 +91,13 @@ static av_always_inline int get_cabac_inline_x86(CABACContext *c,
91 91
     int bit, tmp;
92 92
 
93 93
     __asm__ volatile(
94
-        BRANCHLESS_GET_CABAC("%0", "(%5)", "%1", "%w1", "%2",
95
-                             "%3", "%b3", "%4")
96
-        :"=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp),
97
-         "+m"(c->bytestream)
98
-        :"r"(state)
94
+        BRANCHLESS_GET_CABAC("%0", "(%4)", "%1", "%w1",
95
+                             "%2", "%3", "%b3",
96
+                             "%a6(%5)", "%a7(%5)")
97
+        : "=&r"(bit), "+&r"(c->low), "+&r"(c->range), "=&q"(tmp)
98
+        : "r"(state), "r"(c),
99
+          "i"(offsetof(CABACContext, bytestream)),
100
+          "i"(offsetof(CABACContext, bytestream_end))
99 101
         : "%"REG_c, "memory"
100 102
     );
101 103
     return bit & 1;
... ...
@@ -107,32 +109,36 @@ static av_always_inline int get_cabac_bypass_sign_x86(CABACContext *c, int val)
107 107
 {
108 108
     x86_reg tmp;
109 109
     __asm__ volatile(
110
-        "movl %4, %k1                           \n\t"
111
-        "movl %2, %%eax                         \n\t"
112
-        "shl $17, %k1                           \n\t"
113
-        "add %%eax, %%eax                       \n\t"
114
-        "sub %k1, %%eax                         \n\t"
115
-        "cltd                                   \n\t"
116
-        "and %%edx, %k1                         \n\t"
117
-        "add %k1, %%eax                         \n\t"
118
-        "xor %%edx, %%ecx                       \n\t"
119
-        "sub %%edx, %%ecx                       \n\t"
120
-        "test %%ax, %%ax                        \n\t"
121
-        " jnz 1f                                \n\t"
122
-        "mov  %3, %1                            \n\t"
123
-        "subl $0xFFFF, %%eax                    \n\t"
124
-        "movzwl (%1), %%edx                     \n\t"
125
-        "bswap %%edx                            \n\t"
126
-        "shrl $15, %%edx                        \n\t"
127
-        "add  $2, %1                            \n\t"
128
-        "addl %%edx, %%eax                      \n\t"
129
-        "mov  %1, %3                            \n\t"
130
-        "1:                                     \n\t"
131
-        "movl %%eax, %2                         \n\t"
110
+        "movl        %a6(%2), %k1       \n\t"
111
+        "movl        %a3(%2), %%eax     \n\t"
112
+        "shl             $17, %k1       \n\t"
113
+        "add           %%eax, %%eax     \n\t"
114
+        "sub             %k1, %%eax     \n\t"
115
+        "cltd                           \n\t"
116
+        "and           %%edx, %k1       \n\t"
117
+        "add             %k1, %%eax     \n\t"
118
+        "xor           %%edx, %%ecx     \n\t"
119
+        "sub           %%edx, %%ecx     \n\t"
120
+        "test           %%ax, %%ax      \n\t"
121
+        "jnz              1f            \n\t"
122
+        "mov         %a4(%2), %1        \n\t"
123
+        "subl        $0xFFFF, %%eax     \n\t"
124
+        "movzwl         (%1), %%edx     \n\t"
125
+        "bswap         %%edx            \n\t"
126
+        "shrl            $15, %%edx     \n\t"
127
+        "add              $2, %1        \n\t"
128
+        "addl          %%edx, %%eax     \n\t"
129
+        "mov              %1, %a4(%2)   \n\t"
130
+        "1:                             \n\t"
131
+        "movl          %%eax, %a3(%2)   \n\t"
132 132
 
133
-        :"+c"(val), "=&r"(tmp), "+m"(c->low), "+m"(c->bytestream)
134
-        :"m"(c->range)
135
-        : "%eax", "%edx"
133
+        : "+c"(val), "=&r"(tmp)
134
+        : "r"(c),
135
+          "i"(offsetof(CABACContext, low)),
136
+          "i"(offsetof(CABACContext, bytestream)),
137
+          "i"(offsetof(CABACContext, bytestream_end)),
138
+          "i"(offsetof(CABACContext, range))
139
+        : "%eax", "%edx", "memory"
136 140
     );
137 141
     return val;
138 142
 }
... ...
@@ -46,17 +46,19 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
46 46
     int bit;
47 47
     x86_reg coeff_count;
48 48
     __asm__ volatile(
49
-        "2:                                     \n\t"
49
+        "3:                                     \n\t"
50 50
 
51
-        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
52
-                             "%w3", "%5", "%k0", "%b0", "%6")
51
+        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3", "%w3",
52
+                             "%5", "%k0", "%b0",
53
+                             "%a11(%6)", "%a12(%6)")
53 54
 
54 55
         "test $1, %4                            \n\t"
55
-        " jz 3f                                 \n\t"
56
+        " jz 4f                                 \n\t"
56 57
         "add  %10, %1                           \n\t"
57 58
 
58
-        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3",
59
-                             "%w3", "%5", "%k0", "%b0", "%6")
59
+        BRANCHLESS_GET_CABAC("%4", "(%1)", "%3", "%w3",
60
+                             "%5", "%k0", "%b0",
61
+                             "%a11(%6)", "%a12(%6)")
60 62
 
61 63
         "sub  %10, %1                           \n\t"
62 64
         "mov  %2, %0                            \n\t"
... ...
@@ -65,25 +67,26 @@ static int decode_significance_x86(CABACContext *c, int max_coeff,
65 65
         "movl %%ecx, (%0)                       \n\t"
66 66
 
67 67
         "test $1, %4                            \n\t"
68
-        " jnz 4f                                \n\t"
68
+        " jnz 5f                                \n\t"
69 69
 
70 70
         "add"OPSIZE"  $4, %2                    \n\t"
71 71
 
72
-        "3:                                     \n\t"
72
+        "4:                                     \n\t"
73 73
         "add  $1, %1                            \n\t"
74 74
         "cmp  %8, %1                            \n\t"
75
-        " jb 2b                                 \n\t"
75
+        " jb 3b                                 \n\t"
76 76
         "mov  %2, %0                            \n\t"
77 77
         "movl %7, %%ecx                         \n\t"
78 78
         "add  %1, %%"REG_c"                     \n\t"
79 79
         "movl %%ecx, (%0)                       \n\t"
80
-        "4:                                     \n\t"
80
+        "5:                                     \n\t"
81 81
         "add  %9, %k0                           \n\t"
82 82
         "shr $2, %k0                            \n\t"
83
-        :"=&q"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index),
84
-         "+&r"(c->low), "=&r"(bit), "+&r"(c->range),
85
-         "+m"(c->bytestream)
86
-        :"m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off)
83
+        : "=&q"(coeff_count), "+r"(significant_coeff_ctx_base), "+m"(index),
84
+          "+&r"(c->low), "=&r"(bit), "+&r"(c->range)
85
+        : "r"(c), "m"(minusstart), "m"(end), "m"(minusindex), "m"(last_off),
86
+          "i"(offsetof(CABACContext, bytestream)),
87
+          "i"(offsetof(CABACContext, bytestream_end))
87 88
         : "%"REG_c, "memory"
88 89
     );
89 90
     return coeff_count;
... ...
@@ -99,47 +102,52 @@ static int decode_significance_8x8_x86(CABACContext *c,
99 99
     x86_reg state;
100 100
     __asm__ volatile(
101 101
         "mov %1, %6                             \n\t"
102
-        "2:                                     \n\t"
102
+        "3:                                     \n\t"
103 103
 
104 104
         "mov %10, %0                            \n\t"
105 105
         "movzbl (%0, %6), %k6                   \n\t"
106 106
         "add %9, %6                             \n\t"
107 107
 
108
-        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
109
-                             "%w3", "%5", "%k0", "%b0", "%7")
108
+        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3", "%w3",
109
+                             "%5", "%k0", "%b0",
110
+                             "%a12(%7)", "%a13(%7)")
110 111
 
111 112
         "mov %1, %k6                            \n\t"
112 113
         "test $1, %4                            \n\t"
113
-        " jz 3f                                 \n\t"
114
+        " jz 4f                                 \n\t"
114 115
 
115 116
         "movzbl "MANGLE(last_coeff_flag_offset_8x8)"(%k6), %k6\n\t"
116 117
         "add %11, %6                            \n\t"
117 118
 
118
-        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3",
119
-                             "%w3", "%5", "%k0", "%b0", "%7")
119
+        BRANCHLESS_GET_CABAC("%4", "(%6)", "%3", "%w3",
120
+                             "%5", "%k0", "%b0",
121
+                             "%a12(%7)", "%a13(%7)")
120 122
 
121 123
         "mov %2, %0                             \n\t"
122 124
         "mov %1, %k6                            \n\t"
123 125
         "movl %k6, (%0)                         \n\t"
124 126
 
125 127
         "test $1, %4                            \n\t"
126
-        " jnz 4f                                \n\t"
128
+        " jnz 5f                                \n\t"
127 129
 
128 130
         "add"OPSIZE"  $4, %2                    \n\t"
129 131
 
130
-        "3:                                     \n\t"
132
+        "4:                                     \n\t"
131 133
         "addl $1, %k6                           \n\t"
132 134
         "mov %k6, %1                            \n\t"
133 135
         "cmpl $63, %k6                          \n\t"
134
-        " jb 2b                                 \n\t"
136
+        " jb 3b                                 \n\t"
135 137
         "mov %2, %0                             \n\t"
136 138
         "movl %k6, (%0)                         \n\t"
137
-        "4:                                     \n\t"
139
+        "5:                                     \n\t"
138 140
         "addl %8, %k0                           \n\t"
139 141
         "shr $2, %k0                            \n\t"
140
-        :"=&q"(coeff_count),"+m"(last), "+m"(index), "+&r"(c->low), "=&r"(bit),
141
-         "+&r"(c->range), "=&r"(state), "+m"(c->bytestream)
142
-        :"m"(minusindex), "m"(significant_coeff_ctx_base), "m"(sig_off), "m"(last_coeff_ctx_base)
142
+        : "=&q"(coeff_count), "+m"(last), "+m"(index), "+&r"(c->low),
143
+          "=&r"(bit), "+&r"(c->range), "=&r"(state)
144
+        : "r"(c), "m"(minusindex), "m"(significant_coeff_ctx_base),
145
+          "m"(sig_off), "m"(last_coeff_ctx_base),
146
+          "i"(offsetof(CABACContext, bytestream)),
147
+          "i"(offsetof(CABACContext, bytestream_end))
143 148
         : "%"REG_c, "memory"
144 149
     );
145 150
     return coeff_count;
... ...
@@ -102,7 +102,7 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
102 102
     long ioctl_frequency;
103 103
     char *arg;
104 104
     int c;
105
-    struct sigaction act, old;
105
+    struct sigaction act = { 0 }, old;
106 106
 
107 107
     if (idev < 0 || idev > 4)
108 108
     {
... ...
@@ -131,7 +131,6 @@ static av_cold int bktr_init(const char *video_device, int width, int height,
131 131
             frequency = 0.0;
132 132
     }
133 133
 
134
-    memset(&act, 0, sizeof(act));
135 134
     sigemptyset(&act.sa_mask);
136 135
     act.sa_handler = catchsignal;
137 136
     sigaction(SIGUSR1, &act, &old);
... ...
@@ -140,7 +140,7 @@ void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len) {
140 140
     struct AVRC4 rc4;
141 141
     int num_qwords = len >> 3;
142 142
     uint8_t *qwords = data;
143
-    uint64_t rc4buff[8];
143
+    uint64_t rc4buff[8] = { 0 };
144 144
     uint64_t packetkey;
145 145
     uint32_t ms_keys[12];
146 146
     uint64_t ms_state;
... ...
@@ -151,7 +151,6 @@ void ff_asfcrypt_dec(const uint8_t key[20], uint8_t *data, int len) {
151 151
         return;
152 152
     }
153 153
 
154
-    memset(rc4buff, 0, sizeof(rc4buff));
155 154
     av_rc4_init(&rc4, key, 12 * 8, 1);
156 155
     av_rc4_crypt(&rc4, (uint8_t *)rc4buff, NULL, sizeof(rc4buff), NULL, 1);
157 156
     multiswap_init((uint8_t *)rc4buff, ms_keys);
... ...
@@ -1249,7 +1249,7 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
1249 1249
             last_pos=pos;
1250 1250
             }
1251 1251
         }
1252
-        asf->index_read= 1;
1252
+        asf->index_read= ict > 0;
1253 1253
     }
1254 1254
     avio_seek(s->pb, current_pos, SEEK_SET);
1255 1255
 }
... ...
@@ -1021,7 +1021,7 @@ static int mov_write_pasp_tag(AVIOContext *pb, MOVTrack *track)
1021 1021
 static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
1022 1022
 {
1023 1023
     int64_t pos = avio_tell(pb);
1024
-    char compressor_name[32];
1024
+    char compressor_name[32] = { 0 };
1025 1025
 
1026 1026
     avio_wb32(pb, 0); /* size */
1027 1027
     avio_wl32(pb, track->tag); // store it byteswapped
... ...
@@ -1052,7 +1052,6 @@ static int mov_write_video_tag(AVIOContext *pb, MOVTrack *track)
1052 1052
     avio_wb32(pb, 0); /* Data size (= 0) */
1053 1053
     avio_wb16(pb, 1); /* Frame count (= 1) */
1054 1054
 
1055
-    memset(compressor_name,0,32);
1056 1055
     /* FIXME not sure, ISO 14496-1 draft where it shall be set to 0 */
1057 1056
     if (track->mode == MODE_MOV && track->enc->codec && track->enc->codec->name)
1058 1057
         av_strlcpy(compressor_name,track->enc->codec->name,32);
... ...
@@ -60,6 +60,7 @@ flac_header (AVFormatContext * s, int idx)
60 60
 
61 61
         st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
62 62
         st->codec->codec_id = CODEC_ID_FLAC;
63
+        st->need_parsing = AVSTREAM_PARSE_HEADERS;
63 64
 
64 65
         st->codec->extradata =
65 66
             av_malloc(FLAC_STREAMINFO_SIZE + FF_INPUT_BUFFER_PADDING_SIZE);
... ...
@@ -157,8 +157,7 @@ static void rtsp_parse_range_npt(const char *p, int64_t *start, int64_t *end)
157 157
 
158 158
 static int get_sockaddr(const char *buf, struct sockaddr_storage *sock)
159 159
 {
160
-    struct addrinfo hints, *ai = NULL;
161
-    memset(&hints, 0, sizeof(hints));
160
+    struct addrinfo hints = { 0 }, *ai = NULL;
162 161
     hints.ai_flags = AI_NUMERICHOST;
163 162
     if (getaddrinfo(buf, NULL, &hints, &ai))
164 163
         return -1;
... ...
@@ -497,9 +496,8 @@ int ff_sdp_parse(AVFormatContext *s, const char *content)
497 497
      * The Vorbis FMTP line can be up to 16KB - see xiph_parse_sdp_line
498 498
      * in rtpdec_xiph.c. */
499 499
     char buf[16384], *q;
500
-    SDPParseState sdp_parse_state, *s1 = &sdp_parse_state;
500
+    SDPParseState sdp_parse_state = { { 0 } }, *s1 = &sdp_parse_state;
501 501
 
502
-    memset(s1, 0, sizeof(SDPParseState));
503 502
     p = content;
504 503
     for (;;) {
505 504
         p += strspn(p, SPACE_CHARS);
... ...
@@ -1950,7 +1948,7 @@ static int rtp_read_header(AVFormatContext *s)
1950 1950
     int ret, port;
1951 1951
     URLContext* in = NULL;
1952 1952
     int payload_type;
1953
-    AVCodecContext codec;
1953
+    AVCodecContext codec = { 0 };
1954 1954
     struct sockaddr_storage addr;
1955 1955
     AVIOContext pb;
1956 1956
     socklen_t addrlen = sizeof(addr);
... ...
@@ -1991,7 +1989,6 @@ static int rtp_read_header(AVFormatContext *s)
1991 1991
     ffurl_close(in);
1992 1992
     in = NULL;
1993 1993
 
1994
-    memset(&codec, 0, sizeof(codec));
1995 1994
     if (ff_rtp_get_codec_info(&codec, payload_type)) {
1996 1995
         av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "
1997 1996
                                 "without an SDP file describing it\n",
... ...
@@ -104,8 +104,7 @@ static int sap_write_header(AVFormatContext *s)
104 104
     }
105 105
 
106 106
     if (!announce_addr[0]) {
107
-        struct addrinfo hints, *ai = NULL;
108
-        memset(&hints, 0, sizeof(hints));
107
+        struct addrinfo hints = { 0 }, *ai = NULL;
109 108
         hints.ai_family = AF_UNSPEC;
110 109
         if (getaddrinfo(host, NULL, &hints, &ai)) {
111 110
             av_log(s, AV_LOG_ERROR, "Unable to resolve %s\n", host);
... ...
@@ -88,7 +88,7 @@ static void sdp_write_header(char *buff, int size, struct sdp_session_level *s)
88 88
 static int resolve_destination(char *dest_addr, int size, char *type,
89 89
                                int type_size)
90 90
 {
91
-    struct addrinfo hints, *ai;
91
+    struct addrinfo hints = { 0 }, *ai;
92 92
     int is_multicast;
93 93
 
94 94
     av_strlcpy(type, "IP4", type_size);
... ...
@@ -98,7 +98,6 @@ static int resolve_destination(char *dest_addr, int size, char *type,
98 98
     /* Resolve the destination, since it must be written
99 99
      * as a numeric IP address in the SDP. */
100 100
 
101
-    memset(&hints, 0, sizeof(hints));
102 101
     if (getaddrinfo(dest_addr, NULL, &hints, &ai))
103 102
         return 0;
104 103
     getnameinfo(ai->ai_addr, ai->ai_addrlen, dest_addr, size,
... ...
@@ -581,12 +580,11 @@ void ff_sdp_write_media(char *buff, int size, AVCodecContext *c, const char *des
581 581
 int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size)
582 582
 {
583 583
     AVDictionaryEntry *title = av_dict_get(ac[0]->metadata, "title", NULL, 0);
584
-    struct sdp_session_level s;
584
+    struct sdp_session_level s = { 0 };
585 585
     int i, j, port, ttl, is_multicast;
586 586
     char dst[32], dst_type[5];
587 587
 
588 588
     memset(buf, 0, size);
589
-    memset(&s, 0, sizeof(struct sdp_session_level));
590 589
     s.user = "-";
591 590
     s.src_addr = "127.0.0.1";    /* FIXME: Properly set this */
592 591
     s.src_type = "IP4";
... ...
@@ -92,11 +92,10 @@ int main(int argc, char **argv)
92 92
     }
93 93
 
94 94
     for(i=0; ; i++){
95
-        AVPacket pkt;
95
+        AVPacket pkt = { 0 };
96 96
         AVStream *av_uninit(st);
97 97
         char ts_buf[60];
98 98
 
99
-        memset(&pkt, 0, sizeof(pkt));
100 99
         if(ret>=0){
101 100
             ret= av_read_frame(ic, &pkt);
102 101
             if(ret>=0){
... ...
@@ -37,7 +37,7 @@ typedef struct TCPContext {
37 37
 /* return non zero if error */
38 38
 static int tcp_open(URLContext *h, const char *uri, int flags)
39 39
 {
40
-    struct addrinfo hints, *ai, *cur_ai;
40
+    struct addrinfo hints = { 0 }, *ai, *cur_ai;
41 41
     int port, fd = -1;
42 42
     TCPContext *s = h->priv_data;
43 43
     int listen_socket = 0;
... ...
@@ -62,7 +62,6 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
62 62
             timeout = strtol(buf, NULL, 10);
63 63
         }
64 64
     }
65
-    memset(&hints, 0, sizeof(hints));
66 65
     hints.ai_family = AF_UNSPEC;
67 66
     hints.ai_socktype = SOCK_STREAM;
68 67
     snprintf(portstr, sizeof(portstr), "%d", port);
... ...
@@ -161,7 +161,7 @@ static int udp_leave_multicast_group(int sockfd, struct sockaddr *addr)
161 161
 static struct addrinfo* udp_resolve_host(const char *hostname, int port,
162 162
                                          int type, int family, int flags)
163 163
 {
164
-    struct addrinfo hints, *res = 0;
164
+    struct addrinfo hints = { 0 }, *res = 0;
165 165
     int error;
166 166
     char sport[16];
167 167
     const char *node = 0, *service = "0";
... ...
@@ -173,7 +173,6 @@ static struct addrinfo* udp_resolve_host(const char *hostname, int port,
173 173
     if ((hostname) && (hostname[0] != '\0') && (hostname[0] != '?')) {
174 174
         node = hostname;
175 175
     }
176
-    memset(&hints, 0, sizeof(hints));
177 176
     hints.ai_socktype = type;
178 177
     hints.ai_family   = family;
179 178
     hints.ai_flags = flags;
... ...
@@ -4073,7 +4073,7 @@ int ff_url_join(char *str, int size, const char *proto,
4073 4073
                 int port, const char *fmt, ...)
4074 4074
 {
4075 4075
 #if CONFIG_NETWORK
4076
-    struct addrinfo hints, *ai;
4076
+    struct addrinfo hints = { 0 }, *ai;
4077 4077
 #endif
4078 4078
 
4079 4079
     str[0] = '\0';
... ...
@@ -4084,7 +4084,6 @@ int ff_url_join(char *str, int size, const char *proto,
4084 4084
 #if CONFIG_NETWORK && defined(AF_INET6)
4085 4085
     /* Determine if hostname is a numerical IPv6 address,
4086 4086
      * properly escape it within [] in that case. */
4087
-    memset(&hints, 0, sizeof(hints));
4088 4087
     hints.ai_flags = AI_NUMERICHOST;
4089 4088
     if (!getaddrinfo(hostname, NULL, &hints, &ai)) {
4090 4089
         if (ai->ai_family == AF_INET6) {
... ...
@@ -101,12 +101,10 @@ int av_image_fill_linesizes(int linesizes[4], enum PixelFormat pix_fmt, int widt
101 101
 int av_image_fill_pointers(uint8_t *data[4], enum PixelFormat pix_fmt, int height,
102 102
                            uint8_t *ptr, const int linesizes[4])
103 103
 {
104
-    int i, total_size, size[4], has_plane[4];
104
+    int i, total_size, size[4] = { 0 }, has_plane[4] = { 0 };
105 105
 
106 106
     const AVPixFmtDescriptor *desc = &av_pix_fmt_descriptors[pix_fmt];
107 107
     memset(data     , 0, sizeof(data[0])*4);
108
-    memset(size     , 0, sizeof(size));
109
-    memset(has_plane, 0, sizeof(has_plane));
110 108
 
111 109
     if ((unsigned)pix_fmt >= PIX_FMT_NB || desc->flags & PIX_FMT_HWACCEL)
112 110
         return AVERROR(EINVAL);
... ...
@@ -517,7 +517,7 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
517 517
 {
518 518
     const char *p;
519 519
     int64_t t;
520
-    struct tm dt;
520
+    struct tm dt = { 0 };
521 521
     int i;
522 522
     static const char * const date_fmt[] = {
523 523
         "%Y-%m-%d",
... ...
@@ -542,8 +542,6 @@ int av_parse_time(int64_t *timeval, const char *timestr, int duration)
542 542
         lastch = '\0';
543 543
     is_utc = (lastch == 'z' || lastch == 'Z');
544 544
 
545
-    memset(&dt, 0, sizeof(dt));
546
-
547 545
     p = timestr;
548 546
     q = NULL;
549 547
     if (!duration) {
... ...
@@ -127,6 +127,9 @@ fate-iff-ilbm: CMD = framecrc -i $(SAMPLES)/iff/lms-matriks.ilbm -pix_fmt rgb24
127 127
 FATE_VIDEO += $(FATE_IFF)
128 128
 fate-iff: $(FATE_IFF)
129 129
 
130
+FATE_VIDEO += fate-kgv1
131
+fate-kgv1: CMD = framecrc -i $(SAMPLES)/kega/kgv1.avi -pix_fmt rgb555le -an
132
+
130 133
 FATE_VIDEO += fate-kmvc
131 134
 fate-kmvc: CMD = framecrc -i $(SAMPLES)/KMVC/LOGO1.AVI -an -t 3 -pix_fmt rgb24
132 135
 
... ...
@@ -38,6 +38,10 @@ $(foreach N,$(VP8_SUITE),$(eval $(call FATE_VP8_SUITE,$(N),$(1),$(2))))
38 38
 FATE_VP8 += fate-vp8-sign-bias$(1)
39 39
 fate-vp8-sign-bias$(1): CMD = framemd5 $(2) -i $(SAMPLES)/vp8/sintel-signbias.ivf
40 40
 fate-vp8-sign-bias$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-sign-bias
41
+
42
+FATE_VP8 += fate-vp8-size-change$(1)
43
+fate-vp8-size-change$(1): CMD = framemd5 $(2) -i $(SAMPLES)/vp8/frame_size_change.webm -frames:v 30
44
+fate-vp8-size-change$(1): REF = $(SRC_PATH)/tests/ref/fate/vp8-size-change
41 45
 endef
42 46
 
43 47
 $(eval $(call FATE_VP8_FULL))
44 48
new file mode 100644
... ...
@@ -0,0 +1,314 @@
0
+#tb 0: 1/60
1
+0,          0,          0,        1,   153600, 0x00000000
2
+0,          1,          1,        1,   153600, 0x00000000
3
+0,          2,          2,        1,   153600, 0x00000000
4
+0,          3,          3,        1,   153600, 0x00000000
5
+0,          4,          4,        1,   153600, 0x00000000
6
+0,          5,          5,        1,   153600, 0x00000000
7
+0,          6,          6,        1,   153600, 0x00000000
8
+0,          7,          7,        1,   153600, 0x00000000
9
+0,          8,          8,        1,   153600, 0x00000000
10
+0,          9,          9,        1,   153600, 0x00000000
11
+0,         10,         10,        1,   153600, 0x00000000
12
+0,         11,         11,        1,   153600, 0x00000000
13
+0,         12,         12,        1,   153600, 0x00000000
14
+0,         13,         13,        1,   153600, 0x00000000
15
+0,         14,         14,        1,   153600, 0x00000000
16
+0,         15,         15,        1,   153600, 0x00000000
17
+0,         16,         16,        1,   153600, 0x00000000
18
+0,         17,         17,        1,   153600, 0x00000000
19
+0,         18,         18,        1,   153600, 0x00000000
20
+0,         19,         19,        1,   153600, 0x00000000
21
+0,         20,         20,        1,   153600, 0x00000000
22
+0,         21,         21,        1,   153600, 0x00000000
23
+0,         22,         22,        1,   153600, 0x00000000
24
+0,         23,         23,        1,   153600, 0x00000000
25
+0,         24,         24,        1,   153600, 0x00000000
26
+0,         25,         25,        1,   153600, 0x00000000
27
+0,         26,         26,        1,   153600, 0x00000000
28
+0,         27,         27,        1,   153600, 0x00000000
29
+0,         28,         28,        1,   153600, 0x00000000
30
+0,         29,         29,        1,   153600, 0x00000000
31
+0,         30,         30,        1,   153600, 0x00000000
32
+0,         31,         31,        1,   153600, 0x00000000
33
+0,         32,         32,        1,   153600, 0x00000000
34
+0,         33,         33,        1,   153600, 0x00000000
35
+0,         34,         34,        1,   153600, 0x00000000
36
+0,         35,         35,        1,   153600, 0x00000000
37
+0,         36,         36,        1,   153600, 0x00000000
38
+0,         37,         37,        1,   153600, 0x00000000
39
+0,         38,         38,        1,   153600, 0x00000000
40
+0,         39,         39,        1,   153600, 0x00000000
41
+0,         40,         40,        1,   153600, 0x00000000
42
+0,         41,         41,        1,   153600, 0x00000000
43
+0,         42,         42,        1,   153600, 0x00000000
44
+0,         43,         43,        1,   153600, 0x00000000
45
+0,         44,         44,        1,   153600, 0x00000000
46
+0,         45,         45,        1,   153600, 0x00000000
47
+0,         46,         46,        1,   153600, 0x00000000
48
+0,         47,         47,        1,   153600, 0xab738fc1
49
+0,         48,         48,        1,   153600, 0x520c9bd3
50
+0,         49,         49,        1,   153600, 0x19347233
51
+0,         50,         50,        1,   153600, 0x9e81fe64
52
+0,         51,         51,        1,   153600, 0x75be7504
53
+0,         52,         52,        1,   153600, 0x29374d04
54
+0,         53,         53,        1,   153600, 0xc6b92fd4
55
+0,         54,         54,        1,   153600, 0xeeec5124
56
+0,         55,         55,        1,   153600, 0x2fc36324
57
+0,         56,         56,        1,   153600, 0x112580f4
58
+0,         57,         57,        1,   153600, 0x177b9a84
59
+0,         58,         58,        1,   153600, 0x214abb44
60
+0,         59,         59,        1,   153600, 0x83580173
61
+0,         60,         60,        1,   153600, 0x95f49284
62
+0,         61,         61,        1,   153600, 0xe31c5984
63
+0,         62,         62,        1,   153600, 0xf1756984
64
+0,         63,         63,        1,   153600, 0x6c004804
65
+0,         64,         64,        1,   153600, 0xbe6631b4
66
+0,         65,         65,        1,   153600, 0x1d910494
67
+0,         66,         66,        1,   153600, 0xd8ecfc25
68
+0,         67,         67,        1,   153600, 0xdd281364
69
+0,         68,         68,        1,   153600, 0x52545084
70
+0,         69,         69,        1,   153600, 0xfed6b944
71
+0,         70,         70,        1,   153600, 0x6e0b7ee4
72
+0,         71,         71,        1,   153600, 0x516a5724
73
+0,         72,         72,        1,   153600, 0xaffd7844
74
+0,         73,         73,        1,   153600, 0x5a304ba4
75
+0,         74,         74,        1,   153600, 0xea365ce4
76
+0,         75,         75,        1,   153600, 0xef654a84
77
+0,         76,         76,        1,   153600, 0x32d14584
78
+0,         77,         77,        1,   153600, 0x6bf843e4
79
+0,         78,         78,        1,   153600, 0x023d5b94
80
+0,         79,         79,        1,   153600, 0xd4506154
81
+0,         80,         80,        1,   153600, 0xeaf0bd24
82
+0,         81,         81,        1,   153600, 0x426efb94
83
+0,         82,         82,        1,   153600, 0x98bcde64
84
+0,         83,         83,        1,   153600, 0xa1bbb4a4
85
+0,         84,         84,        1,   153600, 0x36688414
86
+0,         85,         85,        1,   153600, 0x2e4b75d4
87
+0,         86,         86,        1,   153600, 0x33885884
88
+0,         87,         87,        1,   153600, 0x6c065224
89
+0,         88,         88,        1,   153600, 0x1a0252b4
90
+0,         89,         89,        1,   153600, 0x55896084
91
+0,         90,         90,        1,   153600, 0xb9df7a04
92
+0,         91,         91,        1,   153600, 0x6f8a9734
93
+0,         92,         92,        1,   153600, 0xa3d3dbb4
94
+0,         93,         93,        1,   153600, 0x907a2483
95
+0,         94,         94,        1,   153600, 0xf4816ad3
96
+0,         95,         95,        1,   153600, 0x4e9195e3
97
+0,         96,         96,        1,   153600, 0xf486a373
98
+0,         97,         97,        1,   153600, 0x8f6aa693
99
+0,         98,         98,        1,   153600, 0x8f6aa693
100
+0,         99,         99,        1,   153600, 0x8f6aa693
101
+0,        100,        100,        1,   153600, 0x8f6aa693
102
+0,        101,        101,        1,   153600, 0x8f6aa693
103
+0,        102,        102,        1,   153600, 0x8f6aa693
104
+0,        103,        103,        1,   153600, 0x17d9c117
105
+0,        104,        104,        1,   153600, 0x17d9c117
106
+0,        105,        105,        1,   153600, 0x17d9c117
107
+0,        106,        106,        1,   153600, 0x17d9c117
108
+0,        107,        107,        1,   153600, 0x17d9c117
109
+0,        108,        108,        1,   153600, 0x7a47386f
110
+0,        109,        109,        1,   153600, 0x7a47386f
111
+0,        110,        110,        1,   153600, 0x7a47386f
112
+0,        111,        111,        1,   153600, 0x7a47386f
113
+0,        112,        112,        1,   153600, 0x7a47386f
114
+0,        113,        113,        1,   153600, 0x829dccaa
115
+0,        114,        114,        1,   153600, 0x829dccaa
116
+0,        115,        115,        1,   153600, 0x829dccaa
117
+0,        116,        116,        1,   153600, 0x829dccaa
118
+0,        117,        117,        1,   153600, 0x829dccaa
119
+0,        118,        118,        1,   153600, 0x2d58ab4a
120
+0,        119,        119,        1,   153600, 0x2d58ab4a
121
+0,        120,        120,        1,   153600, 0x2d58ab4a
122
+0,        121,        121,        1,   153600, 0x2d58ab4a
123
+0,        122,        122,        1,   153600, 0x2d58ab4a
124
+0,        123,        123,        1,   153600, 0x2d58ab4a
125
+0,        124,        124,        1,   153600, 0x2d58ab4a
126
+0,        125,        125,        1,   153600, 0x2d58ab4a
127
+0,        126,        126,        1,   153600, 0x2d58ab4a
128
+0,        127,        127,        1,   153600, 0x2d58ab4a
129
+0,        128,        128,        1,   153600, 0x2d58ab4a
130
+0,        129,        129,        1,   153600, 0x2d58ab4a
131
+0,        130,        130,        1,   153600, 0x2d58ab4a
132
+0,        131,        131,        1,   153600, 0x2d58ab4a
133
+0,        132,        132,        1,   153600, 0x2d58ab4a
134
+0,        133,        133,        1,   153600, 0x2d58ab4a
135
+0,        134,        134,        1,   153600, 0x2d58ab4a
136
+0,        135,        135,        1,   153600, 0x2d58ab4a
137
+0,        136,        136,        1,   153600, 0x2d58ab4a
138
+0,        137,        137,        1,   153600, 0x2d58ab4a
139
+0,        138,        138,        1,   153600, 0x2d58ab4a
140
+0,        139,        139,        1,   153600, 0x2d58ab4a
141
+0,        140,        140,        1,   153600, 0x2d58ab4a
142
+0,        141,        141,        1,   153600, 0x2d58ab4a
143
+0,        142,        142,        1,   153600, 0x2d58ab4a
144
+0,        143,        143,        1,   153600, 0x2d58ab4a
145
+0,        144,        144,        1,   153600, 0x2d58ab4a
146
+0,        145,        145,        1,   153600, 0x2d58ab4a
147
+0,        146,        146,        1,   153600, 0x2d58ab4a
148
+0,        147,        147,        1,   153600, 0x2d58ab4a
149
+0,        148,        148,        1,   153600, 0x2d58ab4a
150
+0,        149,        149,        1,   153600, 0x2d58ab4a
151
+0,        150,        150,        1,   153600, 0x2d58ab4a
152
+0,        151,        151,        1,   153600, 0x2d58ab4a
153
+0,        152,        152,        1,   153600, 0x2d58ab4a
154
+0,        153,        153,        1,   153600, 0x2d58ab4a
155
+0,        154,        154,        1,   153600, 0x2d58ab4a
156
+0,        155,        155,        1,   153600, 0x2d58ab4a
157
+0,        156,        156,        1,   153600, 0x2d58ab4a
158
+0,        157,        157,        1,   153600, 0x2d58ab4a
159
+0,        158,        158,        1,   153600, 0x2d58ab4a
160
+0,        159,        159,        1,   153600, 0x2d58ab4a
161
+0,        160,        160,        1,   153600, 0x2d58ab4a
162
+0,        161,        161,        1,   153600, 0x2d58ab4a
163
+0,        162,        162,        1,   153600, 0x2d58ab4a
164
+0,        163,        163,        1,   153600, 0x2d58ab4a
165
+0,        164,        164,        1,   153600, 0x2d58ab4a
166
+0,        165,        165,        1,   153600, 0x2d58ab4a
167
+0,        166,        166,        1,   153600, 0x2d58ab4a
168
+0,        167,        167,        1,   153600, 0x2d58ab4a
169
+0,        168,        168,        1,   153600, 0x2d58ab4a
170
+0,        169,        169,        1,   153600, 0x2d58ab4a
171
+0,        170,        170,        1,   153600, 0x2d58ab4a
172
+0,        171,        171,        1,   153600, 0x2d58ab4a
173
+0,        172,        172,        1,   153600, 0x2d58ab4a
174
+0,        173,        173,        1,   153600, 0x2d58ab4a
175
+0,        174,        174,        1,   153600, 0x2d58ab4a
176
+0,        175,        175,        1,   153600, 0x2d58ab4a
177
+0,        176,        176,        1,   153600, 0x2d58ab4a
178
+0,        177,        177,        1,   153600, 0x2d58ab4a
179
+0,        178,        178,        1,   153600, 0x2d58ab4a
180
+0,        179,        179,        1,   153600, 0x2d58ab4a
181
+0,        180,        180,        1,   153600, 0x2d58ab4a
182
+0,        181,        181,        1,   153600, 0x2d58ab4a
183
+0,        182,        182,        1,   153600, 0x2d58ab4a
184
+0,        183,        183,        1,   153600, 0x2d58ab4a
185
+0,        184,        184,        1,   153600, 0x2d58ab4a
186
+0,        185,        185,        1,   153600, 0x2d58ab4a
187
+0,        186,        186,        1,   153600, 0x2d58ab4a
188
+0,        187,        187,        1,   153600, 0x2d58ab4a
189
+0,        188,        188,        1,   153600, 0x2d58ab4a
190
+0,        189,        189,        1,   153600, 0x2d58ab4a
191
+0,        190,        190,        1,   153600, 0x2d58ab4a
192
+0,        191,        191,        1,   153600, 0x2d58ab4a
193
+0,        192,        192,        1,   153600, 0x2d58ab4a
194
+0,        193,        193,        1,   153600, 0x2d58ab4a
195
+0,        194,        194,        1,   153600, 0x2d58ab4a
196
+0,        195,        195,        1,   153600, 0x2d58ab4a
197
+0,        196,        196,        1,   153600, 0x2d58ab4a
198
+0,        197,        197,        1,   153600, 0x2d58ab4a
199
+0,        198,        198,        1,   153600, 0x2d58ab4a
200
+0,        199,        199,        1,   153600, 0x2d58ab4a
201
+0,        200,        200,        1,   153600, 0x2d58ab4a
202
+0,        201,        201,        1,   153600, 0x2d58ab4a
203
+0,        202,        202,        1,   153600, 0x2d58ab4a
204
+0,        203,        203,        1,   153600, 0x2d58ab4a
205
+0,        204,        204,        1,   153600, 0x2d58ab4a
206
+0,        205,        205,        1,   153600, 0x2d58ab4a
207
+0,        206,        206,        1,   153600, 0x2d58ab4a
208
+0,        207,        207,        1,   153600, 0x2d58ab4a
209
+0,        208,        208,        1,   153600, 0x2d58ab4a
210
+0,        209,        209,        1,   153600, 0x2d58ab4a
211
+0,        210,        210,        1,   153600, 0x2d58ab4a
212
+0,        211,        211,        1,   153600, 0x2d58ab4a
213
+0,        212,        212,        1,   153600, 0x2d58ab4a
214
+0,        213,        213,        1,   153600, 0x2d58ab4a
215
+0,        214,        214,        1,   153600, 0x2d58ab4a
216
+0,        215,        215,        1,   153600, 0x2d58ab4a
217
+0,        216,        216,        1,   153600, 0x2d58ab4a
218
+0,        217,        217,        1,   153600, 0x2d58ab4a
219
+0,        218,        218,        1,   153600, 0x2d58ab4a
220
+0,        219,        219,        1,   153600, 0x2d58ab4a
221
+0,        220,        220,        1,   153600, 0x2d58ab4a
222
+0,        221,        221,        1,   153600, 0x2d58ab4a
223
+0,        222,        222,        1,   153600, 0x2d58ab4a
224
+0,        223,        223,        1,   153600, 0x2d58ab4a
225
+0,        224,        224,        1,   153600, 0x2d58ab4a
226
+0,        225,        225,        1,   153600, 0x2d58ab4a
227
+0,        226,        226,        1,   153600, 0x2d58ab4a
228
+0,        227,        227,        1,   153600, 0x2d58ab4a
229
+0,        228,        228,        1,   153600, 0x2d58ab4a
230
+0,        229,        229,        1,   153600, 0x2d58ab4a
231
+0,        230,        230,        1,   153600, 0x2d58ab4a
232
+0,        231,        231,        1,   153600, 0x2d58ab4a
233
+0,        232,        232,        1,   153600, 0x2d58ab4a
234
+0,        233,        233,        1,   153600, 0x2d58ab4a
235
+0,        234,        234,        1,   153600, 0x2d58ab4a
236
+0,        235,        235,        1,   153600, 0x2d58ab4a
237
+0,        236,        236,        1,   153600, 0x2d58ab4a
238
+0,        237,        237,        1,   153600, 0x2d58ab4a
239
+0,        238,        238,        1,   153600, 0x2d58ab4a
240
+0,        239,        239,        1,   153600, 0x2d58ab4a
241
+0,        240,        240,        1,   153600, 0x2d58ab4a
242
+0,        241,        241,        1,   153600, 0x2d58ab4a
243
+0,        242,        242,        1,   153600, 0x2d58ab4a
244
+0,        243,        243,        1,   153600, 0x2d58ab4a
245
+0,        244,        244,        1,   153600, 0x2d58ab4a
246
+0,        245,        245,        1,   153600, 0x2d58ab4a
247
+0,        246,        246,        1,   153600, 0x2d58ab4a
248
+0,        247,        247,        1,   153600, 0x2d58ab4a
249
+0,        248,        248,        1,   153600, 0x2d58ab4a
250
+0,        249,        249,        1,   153600, 0x2d58ab4a
251
+0,        250,        250,        1,   153600, 0x2d58ab4a
252
+0,        251,        251,        1,   153600, 0x2d58ab4a
253
+0,        252,        252,        1,   153600, 0x2d58ab4a
254
+0,        253,        253,        1,   153600, 0x2d58ab4a
255
+0,        254,        254,        1,   153600, 0x2d58ab4a
256
+0,        255,        255,        1,   153600, 0x2d58ab4a
257
+0,        256,        256,        1,   153600, 0x2d58ab4a
258
+0,        257,        257,        1,   153600, 0x2d58ab4a
259
+0,        258,        258,        1,   153600, 0x2d58ab4a
260
+0,        259,        259,        1,   153600, 0x2d58ab4a
261
+0,        260,        260,        1,   153600, 0x2d58ab4a
262
+0,        261,        261,        1,   153600, 0x2d58ab4a
263
+0,        262,        262,        1,   153600, 0x2d58ab4a
264
+0,        263,        263,        1,   153600, 0x2d58ab4a
265
+0,        264,        264,        1,   153600, 0x2d58ab4a
266
+0,        265,        265,        1,   153600, 0x2d58ab4a
267
+0,        266,        266,        1,   153600, 0x2d58ab4a
268
+0,        267,        267,        1,   153600, 0x2d58ab4a
269
+0,        268,        268,        1,   153600, 0x2d58ab4a
270
+0,        269,        269,        1,   153600, 0x2d58ab4a
271
+0,        270,        270,        1,   153600, 0x2d58ab4a
272
+0,        271,        271,        1,   153600, 0x2d58ab4a
273
+0,        272,        272,        1,   153600, 0x2d58ab4a
274
+0,        273,        273,        1,   153600, 0x2d58ab4a
275
+0,        274,        274,        1,   153600, 0x2d58ab4a
276
+0,        275,        275,        1,   153600, 0x2d58ab4a
277
+0,        276,        276,        1,   153600, 0x2d58ab4a
278
+0,        277,        277,        1,   153600, 0x2d58ab4a
279
+0,        278,        278,        1,   153600, 0x2d58ab4a
280
+0,        279,        279,        1,   153600, 0x2d58ab4a
281
+0,        280,        280,        1,   153600, 0x2d58ab4a
282
+0,        281,        281,        1,   153600, 0x2d58ab4a
283
+0,        282,        282,        1,   153600, 0x2d58ab4a
284
+0,        283,        283,        1,   153600, 0x2d58ab4a
285
+0,        284,        284,        1,   153600, 0x7815bb72
286
+0,        285,        285,        1,   153600, 0x47ec1353
287
+0,        286,        286,        1,   153600, 0x6599fabc
288
+0,        287,        287,        1,   153600, 0x3d8a8690
289
+0,        288,        288,        1,   153600, 0xc0bc1ba5
290
+0,        289,        289,        1,   153600, 0x07368f2a
291
+0,        290,        290,        1,   153600, 0x81c54b89
292
+0,        291,        291,        1,   153600, 0xbfcae7bf
293
+0,        292,        292,        1,   153600, 0x1348310e
294
+0,        293,        293,        1,   153600, 0xb5489dad
295
+0,        294,        294,        1,   153600, 0xa1eb1408
296
+0,        295,        295,        1,   153600, 0x15e1832c
297
+0,        296,        296,        1,   153600, 0xb789cba5
298
+0,        297,        297,        1,   153600, 0x3ee86e4f
299
+0,        298,        298,        1,   153600, 0x06ea3883
300
+0,        299,        299,        1,   153600, 0xcedd02b7
301
+0,        300,        300,        1,   153600, 0xbce6ce58
302
+0,        301,        301,        1,   153600, 0xaadf9a00
303
+0,        302,        302,        1,   153600, 0x98c865a0
304
+0,        303,        303,        1,   153600, 0x4c8432e0
305
+0,        304,        304,        1,   153600, 0x00000000
306
+0,        305,        305,        1,   153600, 0x00000000
307
+0,        306,        306,        1,   153600, 0x00000000
308
+0,        307,        307,        1,   153600, 0x00000000
309
+0,        308,        308,        1,   153600, 0x00000000
310
+0,        309,        309,        1,   153600, 0x00000000
311
+0,        310,        310,        1,   153600, 0x00000000
312
+0,        311,        311,        1,   153600, 0x00000000
313
+0,        312,        312,        1,   153600, 0x00000000
0 314
new file mode 100644
... ...
@@ -0,0 +1,31 @@
0
+#tb 0: 1/30
1
+0,          0,          0,        1,  3110400, f9b685c9aaa7652faeded50ed1005414
2
+0,          1,          1,        1,  3110400, d22c3d6a1e57ba4af2bd19e09ad7bdb1
3
+0,          2,          2,        1,  3110400, 0d516dc90992321576a1f090b382beab
4
+0,          3,          3,        1,  3110400, a306b1c732dbaea18ad1efd9d3820094
5
+0,          4,          4,        1,  3110400, faddd965d3e70e62cad07dc72225e8c2
6
+0,          5,          5,        1,  3110400, 375795188ae0ce026179aea29cb8a1b4
7
+0,          6,          6,        1,  3110400, aa372227e1630513116ff6678a2c4fcf
8
+0,          7,          7,        1,  3110400, e4937f5756a3bbbe2660c0874514479b
9
+0,          8,          8,        1,  3110400, ad7d1f6a28ac9f6490f1ee7595ef6b94
10
+0,          9,          9,        1,  3110400, 305414d3ca8aca36242e08041b92ad69
11
+0,         10,         10,        1,  3110400, b719401bd210e4fc02be258ca866e50e
12
+0,         11,         11,        1,  3110400, a25f312e44492715f334ab97f50e73ad
13
+0,         12,         12,        1,  3110400, 1da8d6815b3ce412690e86f18444c621
14
+0,         13,         13,        1,  3110400, 0522ee62ed61c900b71f3fff2030026b
15
+0,         14,         14,        1,  3110400, 523d2a4f5571a952f68d5768eb3336dc
16
+0,         15,         15,        1,  3110400, 03a9b1f05d48c25d689f74db4d2cdbe1
17
+0,         16,         16,        1,  3110400, 6ae91271da4f5c6e604df8e04a40ea45
18
+0,         17,         17,        1,  3110400, 5b3e7bac9f61c4248999a2587a630d28
19
+0,         18,         18,        1,  3110400, 60069876ccffeee06a535e471b8916e8
20
+0,         19,         19,        1,  3110400, 9f5101c81bc7702d98baee78c4ffe65d
21
+0,         20,         20,        1,  3110400, c02641360b4d8af4640aa330d9eb8bb0
22
+0,         21,         21,        1,  3110400, 63274292e7d3f2482c3c282722ae3f02
23
+0,         22,         22,        1,  3110400, ae39b5a18260046e96b4b44520ef0f7d
24
+0,         23,         23,        1,  3110400, bb89af6f8f2b13d0cd668d445669f655
25
+0,         24,         24,        1,  3110400, 0ac58c28575b804d9e63395653c3aef2
26
+0,         25,         25,        1,  3110400, 641f2a78e338c733ef159bd36ec7966f
27
+0,         26,         26,        1,  3110400, 9402d455fa5bd556b85f479c42c3a4d2
28
+0,         27,         27,        1,  3110400, fa2407483a8e169a161e45ac6cfa7831
29
+0,         28,         28,        1,  3110400, 087744a0ac52ef96803fc9c4fb17635b
30
+0,         29,         29,        1,  3110400, b62328f2bd00b269cd3a359360b613b7