Rename pbBufPtr() to put_bits_ptr().
[ffmpeg.git] / libavcodec / h261enc.c
index a92060a..6a8565c 100644 (file)
  */
 
 /**
- * @file h261enc.c
+ * @file libavcodec/h261enc.c
  * H.261 encoder.
  */
 
 #include "dsputil.h"
 #include "avcodec.h"
 #include "mpegvideo.h"
-#include "h261data.h"
 #include "h261.h"
+#include "h261data.h"
 
 extern uint8_t ff_h261_rl_table_store[2][2*MAX_RUN + MAX_LEVEL + 3];
 
@@ -55,13 +55,13 @@ void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number){
     align_put_bits(&s->pb);
 
     /* Update the pointer to last GOB */
-    s->ptr_lastgob = pbBufPtr(&s->pb);
+    s->ptr_lastgob = put_bits_ptr(&s->pb);
 
     put_bits(&s->pb, 20, 0x10); /* PSC */
 
     temp_ref= s->picture_number * (int64_t)30000 * s->avctx->time_base.num /
                          (1001 * (int64_t)s->avctx->time_base.den); //FIXME maybe this should use a timestamp
-    put_bits(&s->pb, 5, temp_ref & 0x1f); /* TemporalReference */
+    put_sbits(&s->pb, 5, temp_ref); /* TemporalReference */
 
     put_bits(&s->pb, 1, 0); /* split screen off */
     put_bits(&s->pb, 1, 0); /* camera  off */
@@ -309,7 +309,7 @@ static void h261_encode_block(H261Context * h, DCTELEM * block, int n){
                 put_bits(&s->pb, 6, run);
                 assert(slevel != 0);
                 assert(level <= 127);
-                put_bits(&s->pb, 8, slevel & 0xff);
+                put_sbits(&s->pb, 8, slevel);
             } else {
                 put_bits(&s->pb, 1, sign);
             }
@@ -329,6 +329,7 @@ AVCodec h261_encoder = {
     MPV_encode_init,
     MPV_encode_picture,
     MPV_encode_end,
-    .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, -1},
+    .pix_fmts= (enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE},
+    .long_name= NULL_IF_CONFIG_SMALL("H.261"),
 };