]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vorbisenc.c
DirectDraw Surface image decoder
[ffmpeg] / libavcodec / vorbisenc.c
index e47f9965e960b40c8d93631877a1a3a4b9e4b94e..12a97bc058f6497e0d1c332299f7b6ad015bf1d9 100644 (file)
  */
 
 #include <float.h>
+
 #include "avcodec.h"
 #include "internal.h"
 #include "fft.h"
+#include "mathops.h"
 #include "vorbis.h"
 #include "vorbis_enc_data.h"
 
@@ -37,7 +39,7 @@
 #undef NDEBUG
 #include <assert.h>
 
-typedef struct {
+typedef struct vorbis_enc_codebook {
     int nentries;
     uint8_t *lens;
     uint32_t *codewords;
@@ -51,14 +53,14 @@ typedef struct {
     float *pow2;
 } vorbis_enc_codebook;
 
-typedef struct {
+typedef struct vorbis_enc_floor_class {
     int dim;
     int subclass;
     int masterbook;
     int *books;
 } vorbis_enc_floor_class;
 
-typedef struct {
+typedef struct vorbis_enc_floor {
     int partitions;
     int *partition_to_class;
     int nclasses;
@@ -69,7 +71,7 @@ typedef struct {
     vorbis_floor1_entry *list;
 } vorbis_enc_floor;
 
-typedef struct {
+typedef struct vorbis_enc_residue {
     int type;
     int begin;
     int end;
@@ -80,7 +82,7 @@ typedef struct {
     float (*maxes)[2];
 } vorbis_enc_residue;
 
-typedef struct {
+typedef struct vorbis_enc_mapping {
     int submaps;
     int *mux;
     int *floor;
@@ -90,12 +92,12 @@ typedef struct {
     int *angle;
 } vorbis_enc_mapping;
 
-typedef struct {
+typedef struct vorbis_enc_mode {
     int blockflag;
     int mapping;
 } vorbis_enc_mode;
 
-typedef struct {
+typedef struct vorbis_enc_context {
     int channels;
     int sample_rate;
     int log2_blocksize[2];
@@ -1089,11 +1091,12 @@ static int vorbis_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     avpkt->size = put_bits_count(&pb) >> 3;
 
     avpkt->duration = ff_samples_to_time_base(avctx, avctx->frame_size);
-    if (frame)
+    if (frame) {
         if (frame->pts != AV_NOPTS_VALUE)
             avpkt->pts = ff_samples_to_time_base(avctx, frame->pts);
-    else
+    } else {
         avpkt->pts = venc->next_pts;
+    }
     if (avpkt->pts != AV_NOPTS_VALUE)
         venc->next_pts = avpkt->pts + avpkt->duration;
 
@@ -1195,6 +1198,7 @@ error:
 
 AVCodec ff_vorbis_encoder = {
     .name           = "vorbis",
+    .long_name      = NULL_IF_CONFIG_SMALL("Vorbis"),
     .type           = AVMEDIA_TYPE_AUDIO,
     .id             = AV_CODEC_ID_VORBIS,
     .priv_data_size = sizeof(vorbis_enc_context),
@@ -1204,5 +1208,4 @@ AVCodec ff_vorbis_encoder = {
     .capabilities   = CODEC_CAP_DELAY | CODEC_CAP_EXPERIMENTAL,
     .sample_fmts    = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP,
                                                      AV_SAMPLE_FMT_NONE },
-    .long_name      = NULL_IF_CONFIG_SMALL("Vorbis"),
 };