Browse Source

Merge remote-tracking branch 'qatar/master'

* qatar/master:
  swfdec: Add support for sample_rate_code 0 (5512 Hz)
  dct-test: factor out some common code and do whas was likely intended
  doc: library versions need to be bumped in version.h
  Revert "ffmpeg: get rid of useless AVInputStream.nb_streams."
  Remove some forgotten AVCodecContext.palctrl usage.
  lavc/utils: move avcodec_init() higher in the file.
  lavc: replace some deprecated FF_*_TYPE with AV_PICTURE_TYPE_*
  ac3dec: actually use drc_scale private option
  lavc: undeprecate AVPALETTE_SIZE and AVPALETTE_COUNT macros
  alsa: add missing header
  msmpeg4: remove leftover unused debug variable declaration
  Fix assert() calls that need updates after FF_COMMON_FRAME macro elimination.
  Fix av_dlog invocations with wrong or missing logging context.
  vf_yadif: add support to yuva420p
  vf_yadif: correct documentation on the parity parameter
  vf_yadif: copy buffer properties like aspect for second frame as well
  oma: support for encrypted files
  id3v2: add support for non-text and GEOB type tag frames
  des: add possibility to calculate DES-CBC-MAC with small buffer

Conflicts:
	ffmpeg.c
	libavcodec/dct-test.c
	libavformat/mpegts.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
Michael Niedermayer 13 years ago
parent
commit
3e1a7ae44a

+ 1 - 1
doc/developer.texi

@@ -310,7 +310,7 @@ send a reminder by email. Your patch should eventually be dealt with.
     AVInputFormat/AVOutputFormat struct?
 @item
     Did you bump the minor version number (and reset the micro version
-    number) in @file{avcodec.h} or @file{avformat.h}?
+    number) in @file{libavcodec/version.h} or @file{libavformat/version.h}?
 @item
     Did you register it in @file{allcodecs.c} or @file{allformats.c}?
 @item

+ 6 - 1
libavcodec/ac3dec.c

@@ -176,6 +176,11 @@ static av_cold int ac3_decode_init(AVCodecContext *avctx)
     AC3DecodeContext *s = avctx->priv_data;
     s->avctx = avctx;
 
+#if FF_API_DRC_SCALE
+    if (avctx->drc_scale)
+        s->drc_scale = avctx->drc_scale;
+#endif
+
     ff_ac3_common_init();
     ac3_tables_init();
     ff_mdct_init(&s->imdct_256, 8, 1, 1.0);
@@ -788,7 +793,7 @@ static int decode_audio_block(AC3DecodeContext *s, int blk)
     do {
         if(get_bits1(gbc)) {
             s->dynamic_range[i] = ((dynamic_range_tab[get_bits(gbc, 8)]-1.0) *
-                                  s->avctx->drc_scale)+1.0;
+                                  s->drc_scale)+1.0;
         } else if(blk == 0) {
             s->dynamic_range[i] = 1.0f;
         }

+ 2 - 2
libavcodec/avcodec.h

@@ -3149,6 +3149,8 @@ typedef struct AVPicture {
     int linesize[4];       ///< number of bytes per line
 } AVPicture;
 
+#define AVPALETTE_SIZE 1024
+#define AVPALETTE_COUNT 256
 #if FF_API_PALETTE_CONTROL
 /**
  * AVPaletteControl
@@ -3158,8 +3160,6 @@ typedef struct AVPicture {
  * @deprecated Use AVPacket to send palette changes instead.
  * This is totally broken.
  */
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
 typedef struct AVPaletteControl {
 
     /* Demuxer sets this to 1 to indicate the palette has changed;

+ 54 - 73
libavcodec/dct-test.c

@@ -199,6 +199,55 @@ static inline void mmx_emms(void)
 #endif
 }
 
+static void init_block(DCTELEM block[64], int test, int is_idct, AVLFG *prng, int vals)
+{
+    int i, j;
+
+    memset(block, 0, 64 * sizeof(*block));
+
+    switch (test) {
+    case 0:
+        for (i = 0; i < 64; i++)
+            block[i] = (av_lfg_get(prng) % (2*vals)) -vals;
+        if (is_idct) {
+            ff_ref_fdct(block);
+            for (i = 0; i < 64; i++)
+                block[i] >>= 3;
+        }
+        break;
+    case 1:
+        j = av_lfg_get(prng) % 10 + 1;
+        for (i = 0; i < j; i++)
+            block[av_lfg_get(prng) % 64] = av_lfg_get(prng) % (2*vals) -vals;
+        break;
+    case 2:
+        block[ 0] = av_lfg_get(prng) % (16*vals) - (8*vals);
+        block[63] = (block[0] & 1) ^ 1;
+        break;
+    }
+}
+
+static void permute(DCTELEM dst[64], const DCTELEM src[64], int perm)
+{
+    int i;
+
+    if (perm == MMX_PERM) {
+        for (i = 0; i < 64; i++)
+            dst[idct_mmx_perm[i]] = src[i];
+    } else if (perm == MMX_SIMPLE_PERM) {
+        for (i = 0; i < 64; i++)
+            dst[idct_simple_mmx_perm[i]] = src[i];
+    } else if (perm == SSE2_PERM) {
+        for (i = 0; i < 64; i++)
+            dst[(i & 0x38) | idct_sse2_row_perm[i & 7]] = src[i];
+    } else if (perm == PARTTRANS_PERM) {
+        for (i = 0; i < 64; i++)
+            dst[(i & 0x24) | ((i & 3) << 3) | ((i >> 3) & 3)] = src[i];
+    } else {
+        for (i = 0; i < 64; i++)
+            dst[i] = src[i];
+    }
+}
 
 static int dct_error(const struct algo *dct, int test, int is_idct, int speed, const int bits)
 {
@@ -221,46 +270,8 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
     for (i = 0; i < 64; i++)
         sysErr[i] = 0;
     for (it = 0; it < NB_ITS; it++) {
-        for (i = 0; i < 64; i++)
-            block1[i] = 0;
-        switch (test) {
-        case 0:
-            for (i = 0; i < 64; i++)
-                block1[i] = (av_lfg_get(&prng) % (2*vals)) -vals;
-            if (is_idct) {
-                ff_ref_fdct(block1);
-                for (i = 0; i < 64; i++)
-                    block1[i] >>= 3;
-            }
-            break;
-        case 1: {
-                int num = av_lfg_get(&prng) % 10 + 1;
-                for (i = 0; i < num; i++)
-                    block1[av_lfg_get(&prng) % 64] = av_lfg_get(&prng) % (2*vals) -vals;
-            }
-            break;
-        case 2:
-            block1[0] = av_lfg_get(&prng) % (16*vals) - (8*vals);
-            block1[63] = (block1[0] & 1) ^ 1;
-            break;
-        }
-
-        if (dct->format == MMX_PERM) {
-            for (i = 0; i < 64; i++)
-                block[idct_mmx_perm[i]] = block1[i];
-        } else if (dct->format == MMX_SIMPLE_PERM) {
-            for (i = 0; i < 64; i++)
-                block[idct_simple_mmx_perm[i]] = block1[i];
-        } else if (dct->format == SSE2_PERM) {
-            for (i = 0; i < 64; i++)
-                block[(i & 0x38) | idct_sse2_row_perm[i & 7]] = block1[i];
-        } else if (dct->format == PARTTRANS_PERM) {
-            for (i = 0; i < 64; i++)
-                block[(i & 0x24) | ((i & 3) << 3) | ((i >> 3) & 3)] = block1[i];
-        } else {
-            for (i = 0; i < 64; i++)
-                block[i] = block1[i];
-        }
+        init_block(block1, test, is_idct, &prng, vals);
+        permute(block, block1, dct->format);
 
         dct->func(block);
         mmx_emms();
@@ -317,45 +328,15 @@ static int dct_error(const struct algo *dct, int test, int is_idct, int speed, c
         return 0;
 
     /* speed test */
-    for (i = 0; i < 64; i++)
-        block1[i] = 0;
-
-    switch (test) {
-    case 0:
-        for (i = 0; i < 64; i++)
-            block1[i] = av_lfg_get(&prng) % (2*vals) -vals;
-        if (is_idct) {
-            ff_ref_fdct(block1);
-            for (i = 0; i < 64; i++)
-                block1[i] >>= 3;
-        }
-        break;
-    case 1:
-    case 2:
-        block1[0] = av_lfg_get(&prng) % (2*vals) -vals;
-        block1[1] = av_lfg_get(&prng) % (2*vals) -vals;
-        block1[2] = av_lfg_get(&prng) % (2*vals) -vals;
-        block1[3] = av_lfg_get(&prng) % (2*vals) -vals;
-        break;
-    }
 
-    if (dct->format == MMX_PERM) {
-        for (i = 0; i < 64; i++)
-            block[idct_mmx_perm[i]] = block1[i];
-    } else if (dct->format == MMX_SIMPLE_PERM) {
-        for (i = 0; i < 64; i++)
-            block[idct_simple_mmx_perm[i]] = block1[i];
-    } else {
-        for (i = 0; i < 64; i++)
-            block[i] = block1[i];
-    }
+    init_block(block, test, is_idct, &prng, vals);
+    permute(block1, block, dct->format);
 
     ti = gettime();
     it1 = 0;
     do {
         for (it = 0; it < NB_ITS_SPEED; it++) {
-            for (i = 0; i < 64; i++)
-                block[i] = block1[i];
+            memcpy(block, block1, sizeof(block));
             dct->func(block);
         }
         it1 += NB_ITS_SPEED;

+ 2 - 2
libavcodec/h261dec.c

@@ -620,8 +620,8 @@ retry:
     }
     MPV_frame_end(s);
 
-assert(s->current_picture.pict_type == s->current_picture_ptr->pict_type);
-assert(s->current_picture.pict_type == s->pict_type);
+assert(s->current_picture.f.pict_type == s->current_picture_ptr->f.pict_type);
+assert(s->current_picture.f.pict_type == s->pict_type);
     *pict= *(AVFrame*)s->current_picture_ptr;
     ff_print_debug_info(s, pict);
 

+ 1 - 1
libavcodec/h264.c

@@ -2774,7 +2774,7 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
         if (s0->first_field) {
             assert(s0->current_picture_ptr);
             assert(s0->current_picture_ptr->f.data[0]);
-            assert(s0->current_picture_ptr->reference != DELAYED_PIC_REF);
+            assert(s0->current_picture_ptr->f.reference != DELAYED_PIC_REF);
 
             /* figure out if we have a complementary field pair */
             if (!FIELD_PICTURE || s->picture_structure == last_pic_structure) {

+ 2 - 2
libavcodec/h264_direct.c

@@ -172,7 +172,7 @@ static void pred_spatial_direct_motion(H264Context * const h, int *mb_type){
     int mv[2];
     int list;
 
-    assert(h->ref_list[1][0].reference&3);
+    assert(h->ref_list[1][0].f.reference & 3);
 
     await_reference_mb_row(h, &h->ref_list[1][0], s->mb_y + !!IS_INTERLACED(*mb_type));
 
@@ -416,7 +416,7 @@ static void pred_temp_direct_motion(H264Context * const h, int *mb_type){
     unsigned int sub_mb_type;
     int i8, i4;
 
-    assert(h->ref_list[1][0].reference&3);
+    assert(h->ref_list[1][0].f.reference & 3);
 
     await_reference_mb_row(h, &h->ref_list[1][0], s->mb_y + !!IS_INTERLACED(*mb_type));
 

+ 1 - 1
libavcodec/mpeg12.c

@@ -1176,7 +1176,7 @@ static int mpeg_decode_update_thread_context(AVCodecContext *avctx, const AVCode
     if (!ctx->mpeg_enc_ctx_allocated)
         memcpy(s + 1, s1 + 1, sizeof(Mpeg1Context) - sizeof(MpegEncContext));
 
-    if (!(s->pict_type == FF_B_TYPE || s->low_delay))
+    if (!(s->pict_type == AV_PICTURE_TYPE_B || s->low_delay))
         s->picture_number++;
 
     return 0;

+ 4 - 4
libavcodec/mpegvideo.c

@@ -225,7 +225,7 @@ static int alloc_frame_buffer(MpegEncContext *s, Picture *pic)
     int r;
 
     if (s->avctx->hwaccel) {
-        assert(!pic->hwaccel_picture_private);
+        assert(!pic->f.hwaccel_picture_private);
         if (s->avctx->hwaccel->priv_data_size) {
             pic->f.hwaccel_picture_private = av_mallocz(s->avctx->hwaccel->priv_data_size);
             if (!pic->f.hwaccel_picture_private) {
@@ -276,7 +276,7 @@ int ff_alloc_picture(MpegEncContext *s, Picture *pic, int shared){
 
     if(shared){
         assert(pic->f.data[0]);
-        assert(pic->type == 0 || pic->type == FF_BUFFER_TYPE_SHARED);
+        assert(pic->f.type == 0 || pic->f.type == FF_BUFFER_TYPE_SHARED);
         pic->f.type = FF_BUFFER_TYPE_SHARED;
     }else{
         assert(!pic->f.data[0]);
@@ -539,7 +539,7 @@ int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src
         s->last_pict_type= s1->pict_type;
         if (s1->current_picture_ptr) s->last_lambda_for[s1->pict_type] = s1->current_picture_ptr->f.quality;
 
-        if(s1->pict_type!=FF_B_TYPE){
+        if (s1->pict_type != AV_PICTURE_TYPE_B) {
             s->last_non_b_pict_type= s1->pict_type;
         }
     }
@@ -2662,6 +2662,6 @@ void ff_set_qscale(MpegEncContext * s, int qscale)
 
 void MPV_report_decode_progress(MpegEncContext *s)
 {
-    if (s->pict_type != FF_B_TYPE && !s->partitioned_frame && !s->error_occurred)
+    if (s->pict_type != AV_PICTURE_TYPE_B && !s->partitioned_frame && !s->error_occurred)
         ff_thread_report_progress((AVFrame*)s->current_picture_ptr, s->mb_y, 0);
 }

+ 5 - 5
libavcodec/mpegvideo_enc.c

@@ -1093,8 +1093,8 @@ static int select_input_picture(MpegEncContext *s){
                             s->input_picture[0]->f.data[i] = NULL;
                         s->input_picture[0]->f.type = 0;
                     }else{
-                        assert(   s->input_picture[0]->type==FF_BUFFER_TYPE_USER
-                               || s->input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
+                        assert(   s->input_picture[0]->f.type == FF_BUFFER_TYPE_USER
+                               || s->input_picture[0]->f.type == FF_BUFFER_TYPE_INTERNAL);
 
                         s->avctx->release_buffer(s->avctx, (AVFrame*)s->input_picture[0]);
                     }
@@ -1220,8 +1220,8 @@ no_output_pic:
         }else{
             // input is not a shared pix -> reuse buffer for current_pix
 
-            assert(   s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_USER
-                   || s->reordered_input_picture[0]->type==FF_BUFFER_TYPE_INTERNAL);
+            assert(   s->reordered_input_picture[0]->f.type == FF_BUFFER_TYPE_USER
+                   || s->reordered_input_picture[0]->f.type == FF_BUFFER_TYPE_INTERNAL);
 
             s->current_picture_ptr= s->reordered_input_picture[0];
             for(i=0; i<4; i++){
@@ -2757,7 +2757,7 @@ static int estimate_qp(MpegEncContext *s, int dry_run){
 
 /* must be called before writing the header */
 static void set_frame_distances(MpegEncContext * s){
-    assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
+    assert(s->current_picture_ptr->f.pts != AV_NOPTS_VALUE);
     s->time = s->current_picture_ptr->f.pts * s->avctx->time_base.num;
 
     if(s->pict_type==AV_PICTURE_TYPE_B){

Some files were not shown because too many files changed in this diff