]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/libdirac_libschro.c
Lossless jpeg expects and uses BGRA not RGB32 (this probably caused a problem on
[ffmpeg] / libavcodec / libdirac_libschro.c
index df9133da5d2044cd3b4c86a5b8b00025c3a896a3..115cc49965120fa087d9067cdfe4fb7b9f6e8122 100644 (file)
@@ -45,46 +45,42 @@ static const FfmpegDiracSchroVideoFormatInfo ff_dirac_schro_video_format_info[]
     { 4096, 2160, 24,    1   },
 };
 
-unsigned int ff_dirac_schro_get_video_format_idx (AVCodecContext *avccontext)
+unsigned int ff_dirac_schro_get_video_format_idx(AVCodecContext *avccontext)
 {
     unsigned int ret_idx = 0;
     unsigned int idx;
     unsigned int num_formats = sizeof(ff_dirac_schro_video_format_info) /
                                sizeof(ff_dirac_schro_video_format_info[0]);
 
-    for (idx = 1 ; idx < num_formats; ++idx ) {
-        const FfmpegDiracSchroVideoFormatInfo *vf =
-                                        &ff_dirac_schro_video_format_info[idx];
+    for (idx = 1; idx < num_formats; ++idx) {
+        const FfmpegDiracSchroVideoFormatInfo *vf = &ff_dirac_schro_video_format_info[idx];
         if (avccontext->width  == vf->width &&
-            avccontext->height == vf->height){
+            avccontext->height == vf->height) {
             ret_idx = idx;
             if (avccontext->time_base.den == vf->frame_rate_num &&
-                avccontext->time_base.num == vf->frame_rate_denom) {
+                avccontext->time_base.num == vf->frame_rate_denom)
                 return idx;
-            }
         }
     }
     return ret_idx;
 }
 
-void ff_dirac_schro_queue_init (FfmpegDiracSchroQueue *queue)
+void ff_dirac_schro_queue_init(FfmpegDiracSchroQueue *queue)
 {
     queue->p_head = queue->p_tail = NULL;
     queue->size = 0;
 }
 
-void ff_dirac_schro_queue_free (FfmpegDiracSchroQueue *queue,
-                                void (*free_func)(void *))
+void ff_dirac_schro_queue_free(FfmpegDiracSchroQueue *queue,
+                               void (*free_func)(void *))
 {
-    while (queue->p_head) {
-        free_func( ff_dirac_schro_queue_pop(queue) );
-    }
+    while (queue->p_head)
+        free_func(ff_dirac_schro_queue_pop(queue));
 }
 
-int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
+int ff_dirac_schro_queue_push_back(FfmpegDiracSchroQueue *queue, void *p_data)
 {
-    FfmpegDiracSchroQueueElement *p_new =
-                             av_mallocz(sizeof(FfmpegDiracSchroQueueElement));
+    FfmpegDiracSchroQueueElement *p_new = av_mallocz(sizeof(FfmpegDiracSchroQueueElement));
 
     if (!p_new)
         return -1;
@@ -101,7 +97,7 @@ int ff_dirac_schro_queue_push_back (FfmpegDiracSchroQueue *queue, void *p_data)
     return 0;
 }
 
-void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue)
+void *ff_dirac_schro_queue_pop(FfmpegDiracSchroQueue *queue)
 {
     FfmpegDiracSchroQueueElement *top = queue->p_head;
 
@@ -109,7 +105,7 @@ void *ff_dirac_schro_queue_pop (FfmpegDiracSchroQueue *queue)
         void *data = top->data;
         queue->p_head = queue->p_head->next;
         --queue->size;
-        av_freep (&top);
+        av_freep(&top);
         return data;
     }