]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libtheoraenc.c
imc: fix undefined float to int conversion
[ffmpeg] / libavcodec / libtheoraenc.c
index ac015ff20000fa5b91164b23c7808bf98296e42c..e4ca721166596ba17be7d5f444ecca320e769a7c 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-/*!
- * \file libtheoraenc.c
- * \brief Theora encoder using libtheora.
- * \author Paul Richards <paul.richards@gmail.com>
+/**
+ * @file
+ * @brief Theora encoder using libtheora.
+ * @author Paul Richards <paul.richards@gmail.com>
  *
  * A lot of this is copy / paste from other output codecs in
  * libavcodec or pure guesswork (or both).
@@ -49,9 +49,7 @@ typedef struct TheoraContext {
     int         keyframe_mask;
 } TheoraContext;
 
-/*!
-    Concatenates an ogg_packet into the extradata.
-*/
+/** Concatenate an ogg_packet into the extradata. */
 static int concatenate_packet(unsigned int* offset,
                               AVCodecContext* avc_context,
                               const ogg_packet* packet)
@@ -103,7 +101,7 @@ static int get_stats(AVCodecContext *avctx, int eos)
         memcpy(h->stats + h->stats_offset, buf, bytes);
         h->stats_offset += bytes;
     } else {
-        int b64_size = ((h->stats_offset + 2) / 3) * 4 + 1;
+        int b64_size = AV_BASE64_SIZE(h->stats_offset);
         // libtheora generates a summary header at the end
         memcpy(h->stats, buf, bytes);
         avctx->stats_out = av_malloc(b64_size);
@@ -358,10 +356,10 @@ static av_cold int encode_close(AVCodecContext* avc_context)
     return 0;
 }
 
-/*! AVCodec struct exposed to libavcodec */
+/** AVCodec struct exposed to libavcodec */
 AVCodec libtheora_encoder = {
     .name = "libtheora",
-    .type = CODEC_TYPE_VIDEO,
+    .type = AVMEDIA_TYPE_VIDEO,
     .id = CODEC_ID_THEORA,
     .priv_data_size = sizeof(TheoraContext),
     .init = encode_init,