codecs: h264picture: use g_array_remove_index_fast()
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 14 Jun 2020 18:47:46 +0000 (20:47 +0200)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 29 Jun 2020 12:36:38 +0000 (12:36 +0000)
This algorithm is faster than the normal one. The problem is it
disorders the elements in the dpb, but it does not seem to mess
decoders.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1378>

gst-libs/gst/codecs/gsth264picture.c

index 9364369..90f4003 100644 (file)
@@ -227,7 +227,7 @@ gst_h264_dpb_delete_unused (GstH264Dpb * dpb)
     if (picture->outputted && !picture->ref) {
       GST_TRACE ("remove picture %p (frame num %d) from dpb",
           picture, picture->frame_num);
-      g_array_remove_index (dpb->pic_list, i);
+      g_array_remove_index_fast (dpb->pic_list, i);
       i--;
     }
   }
@@ -255,7 +255,7 @@ gst_h264_dpb_delete_by_poc (GstH264Dpb * dpb, gint poc)
       GST_TRACE ("remove picture %p for poc %d (frame num %d) from dpb",
           picture, poc, picture->frame_num);
 
-      g_array_remove_index (dpb->pic_list, i);
+      g_array_remove_index_fast (dpb->pic_list, i);
       return;
     }
   }