ramiro | 1 Jul 03:36 2008
Picon

r14044 - in trunk/libavcodec: mlp_parser.c mlp_parser.h

Author: ramiro
Date: Tue Jul  1 03:36:16 2008
New Revision: 14044

Log:
Make ff_mlp_read_major_sync() take a GetBitContext instead of buffers.

Modified:
   trunk/libavcodec/mlp_parser.c
   trunk/libavcodec/mlp_parser.h

Modified: trunk/libavcodec/mlp_parser.c
==============================================================================
--- trunk/libavcodec/mlp_parser.c	(original)
+++ trunk/libavcodec/mlp_parser.c	Tue Jul  1 03:36:16 2008
 <at>  <at>  -88,74 +88,73  <at>  <at>  static uint16_t mlp_checksum16(const uin
 /** Read a major sync info header - contains high level information about
  *  the stream - sample rate, channel arrangement etc. Most of this
  *  information is not actually necessary for decoding, only for playback.
+ *  gb must be a freshly initialized GetBitContext with no bits read.
  */

-int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, const uint8_t *buf,
-                           unsigned int buf_size)
+int ff_mlp_read_major_sync(void *log, MLPHeaderInfo *mh, GetBitContext *gb)
 {
-    GetBitContext gb;
     int ratebits;
     uint16_t checksum;

(Continue reading)

lucabe | 2 Jul 12:23 2008
Picon

r14045 - trunk/libavformat/rtpdec.c

Author: lucabe
Date: Wed Jul  2 12:23:27 2008
New Revision: 14045

Log:
Fix A/V synch for RTP streams that do not contain MPEG1 or 2
(correctly compute the presentation times based on the RTP timestamps
and the RTCP SR packets)

Modified:
   trunk/libavformat/rtpdec.c

Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c	(original)
+++ trunk/libavformat/rtpdec.c	Wed Jul  2 12:23:27 2008
 <at>  <at>  -282,6 +282,7  <at>  <at>  RTPDemuxContext *rtp_parse_open(AVFormat
     s->st = st;
     s->rtp_payload_data = rtp_payload_data;
     rtp_init_statistics(&s->statistics, 0); // do we know the initial sequence from sdp?
+    av_set_pts_info(s->st, 32, 1, 90000);
     if (!strcmp(ff_rtp_enc_name(payload_type), "MP2T")) {
         s->ts = mpegts_parse_open(s->ic);
         if (s->ts == NULL) {
 <at>  <at>  -299,6 +300,9  <at>  <at>  RTPDemuxContext *rtp_parse_open(AVFormat
             st->need_parsing = AVSTREAM_PARSE_FULL;
             break;
         default:
+            if (st->codec->codec_type == CODEC_TYPE_AUDIO) {
+                av_set_pts_info(st, 32, 1, st->codec->sample_rate);
(Continue reading)

lucabe | 2 Jul 12:26 2008
Picon

r14046 - trunk/libavformat/rtpdec.c

Author: lucabe
Date: Wed Jul  2 12:26:23 2008
New Revision: 14046

Log:
Reindent after last commit

Modified:
   trunk/libavformat/rtpdec.c

Modified: trunk/libavformat/rtpdec.c
==============================================================================
--- trunk/libavformat/rtpdec.c	(original)
+++ trunk/libavformat/rtpdec.c	Wed Jul  2 12:26:23 2008
 <at>  <at>  -365,16 +365,16  <at>  <at>  static int rtp_parse_mp4_au(RTPDemuxCont
  */
 static void finalize_packet(RTPDemuxContext *s, AVPacket *pkt, uint32_t timestamp)
 {
-            if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) {
-                int64_t addend;
+    if (s->last_rtcp_ntp_time != AV_NOPTS_VALUE) {
+        int64_t addend;
+        int delta_timestamp;

-                int delta_timestamp;
-                /* compute pts from timestamp with received ntp_time */
-                delta_timestamp = timestamp - s->last_rtcp_timestamp;
-                /* convert to the PTS timebase */
-                addend = av_rescale(s->last_rtcp_ntp_time - s->first_rtcp_ntp_time, s->st->time_base.den,
(uint64_t)s->st->time_base.num << 32);
(Continue reading)

ramiro | 2 Jul 14:24 2008
Picon

r14047 - trunk/libavcodec/mlp_parser.c

Author: ramiro
Date: Wed Jul  2 14:24:50 2008
New Revision: 14047

Log:
Clarify comment about parity nibble.

Modified:
   trunk/libavcodec/mlp_parser.c

Modified: trunk/libavcodec/mlp_parser.c
==============================================================================
--- trunk/libavcodec/mlp_parser.c	(original)
+++ trunk/libavcodec/mlp_parser.c	Wed Jul  2 14:24:50 2008
 <at>  <at>  -238,7 +238,8  <at>  <at>  static int mlp_parse(AVCodecParserContex
     sync_present = (AV_RB32(buf + 4) & 0xfffffffe) == 0xf8726fba;

     if (!sync_present) {
-        // First nibble of a frame is a parity check of the first few nibbles.
+        /* The first nibble of a frame is a parity check of the 4-byte
+         * access unit header and all the 2- or 4-byte substream headers. */
         // Only check when this isn't a sync frame - syncs have a checksum.

         parity_bits = 0;
astrange | 2 Jul 23:46 2008
Picon

r14048 - in trunk/libavcodec: h264.c h264.h

Author: astrange
Date: Wed Jul  2 23:46:18 2008
New Revision: 14048

Log:
Don't test for H264 encoding unless an encoder exists.

Modified:
   trunk/libavcodec/h264.c
   trunk/libavcodec/h264.h

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Wed Jul  2 23:46:18 2008
 <at>  <at>  -2726,9 +2726,9  <at>  <at>  static void hl_decode_mb(H264Context *h)
     MpegEncContext * const s = &h->s;
     const int mb_xy= h->mb_xy;
     const int mb_type= s->current_picture.mb_type[mb_xy];
-    int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 ||
(ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || s->encoding;
+    int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 ||
(ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding);

-    if(!s->decode)
+    if(ENABLE_H264_ENCODER && !s->decode)
         return;

     if (is_complex)

(Continue reading)

astrange | 3 Jul 00:03 2008
Picon

r14049 - trunk/libavcodec/h264.c

Author: astrange
Date: Thu Jul  3 00:03:53 2008
New Revision: 14049

Log:
Don't generate two copies of hl_decode_mb() under ENABLE_SMALL.
(assuming your compiler removes unused static functions)

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Thu Jul  3 00:03:53 2008
 <at>  <at>  -2726,7 +2726,7  <at>  <at>  static void hl_decode_mb(H264Context *h)
     MpegEncContext * const s = &h->s;
     const int mb_xy= h->mb_xy;
     const int mb_type= s->current_picture.mb_type[mb_xy];
-    int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 ||
(ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding);
+    int is_complex = FRAME_MBAFF || MB_FIELD || IS_INTRA_PCM(mb_type) || s->codec_id != CODEC_ID_H264 ||
(ENABLE_GRAY && (s->flags&CODEC_FLAG_GRAY)) || (ENABLE_H264_ENCODER && s->encoding) || ENABLE_SMALL;

     if(ENABLE_H264_ENCODER && !s->decode)
         return;
astrange | 3 Jul 00:08 2008
Picon

r14050 - trunk/libavcodec/h264.c

Author: astrange
Date: Thu Jul  3 00:08:12 2008
New Revision: 14050

Log:
Clone decode_cabac_residual() for DC residuals, to get rid of a bunch of branches in the main loop.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Thu Jul  3 00:08:12 2008
 <at>  <at>  -5337,24 +5337,28  <at>  <at>  static int decode_cabac_mb_mvd( H264Cont
     return get_cabac_bypass_sign( &h->cabac, -mvd );
 }

-static inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx ) {
+static av_always_inline int get_cabac_cbf_ctx( H264Context *h, int cat, int idx, int is_dc ) {
     int nza, nzb;
     int ctx = 0;

+    if( is_dc ) {
     if( cat == 0 ) {
         nza = h->left_cbp&0x100;
         nzb = h-> top_cbp&0x100;
-    } else if( cat == 1 || cat == 2 ) {
-        nza = h->non_zero_count_cache[scan8[idx] - 1];
-        nzb = h->non_zero_count_cache[scan8[idx] - 8];
(Continue reading)

astrange | 3 Jul 00:12 2008
Picon

r14051 - trunk/libavcodec/h264.c

Author: astrange
Date: Thu Jul  3 00:12:01 2008
New Revision: 14051

Log:
Reindent.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Thu Jul  3 00:12:01 2008
 <at>  <at>  -5342,22 +5342,22  <at>  <at>  static av_always_inline int get_cabac_cb
     int ctx = 0;

     if( is_dc ) {
-    if( cat == 0 ) {
-        nza = h->left_cbp&0x100;
-        nzb = h-> top_cbp&0x100;
-    } else {
-        nza = (h->left_cbp>>(6+idx))&0x01;
-        nzb = (h-> top_cbp>>(6+idx))&0x01;
-    }
-    } else {
-    if( cat == 1 || cat == 2 ) {
-        nza = h->non_zero_count_cache[scan8[idx] - 1];
-        nzb = h->non_zero_count_cache[scan8[idx] - 8];
+        if( cat == 0 ) {
(Continue reading)

astrange | 3 Jul 00:15 2008
Picon

r14052 - trunk/libavcodec/h264.c

Author: astrange
Date: Thu Jul  3 00:15:05 2008
New Revision: 14052

Log:
Simplify loop condition for readability.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Thu Jul  3 00:15:05 2008
 <at>  <at>  -5514,7 +5514,7  <at>  <at>  static av_always_inline void decode_caba
         }
     }

-    for( coeff_count--; coeff_count >= 0; coeff_count-- ) {
+    while( coeff_count-- ) {
         uint8_t *ctx = coeff_abs_level1_ctx[node_ctx] + abs_level_m1_ctx_base;

         int j= scantable[index[coeff_count]];
astrange | 3 Jul 00:20 2008
Picon

r14053 - trunk/libavcodec/h264.c

Author: astrange
Date: Thu Jul  3 00:20:06 2008
New Revision: 14053

Log:
Reorder the if/else for residual cats to match gcc's branch prediction.

Modified:
   trunk/libavcodec/h264.c

Modified: trunk/libavcodec/h264.c
==============================================================================
--- trunk/libavcodec/h264.c	(original)
+++ trunk/libavcodec/h264.c	Thu Jul  3 00:20:06 2008
 <at>  <at>  -5350,13 +5350,13  <at>  <at>  static av_always_inline int get_cabac_cb
             nzb = (h-> top_cbp>>(6+idx))&0x01;
         }
     } else {
-        if( cat == 1 || cat == 2 ) {
-            nza = h->non_zero_count_cache[scan8[idx] - 1];
-            nzb = h->non_zero_count_cache[scan8[idx] - 8];
-        } else {
-            assert(cat == 4);
+        if( cat == 4 ) {
             nza = h->non_zero_count_cache[scan8[16+idx] - 1];
             nzb = h->non_zero_count_cache[scan8[16+idx] - 8];
+        } else {
+            assert(cat == 1 || cat == 2);
+            nza = h->non_zero_count_cache[scan8[idx] - 1];
+            nzb = h->non_zero_count_cache[scan8[idx] - 8];
(Continue reading)


Gmane