summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2009-09-18 17:26:42 +0300
committerStefan Kost <ensonic@users.sf.net>2009-09-21 16:07:50 +0300
commit253f43203d6b7c76f69ba3b26c6d91cf30195686 (patch)
tree586aa02735bb8a7080f4755e87a62f2a13dcd256 /ext
parent2f26ee4285db50304f1fc81f1426e0f56198b26c (diff)
jpegdec: add a G_UNLIKELY and put perf-cat log to code path that copies
Diffstat (limited to 'ext')
-rw-r--r--ext/jpeg/gstjpegdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/jpeg/gstjpegdec.c b/ext/jpeg/gstjpegdec.c
index e040342f..7af343c2 100644
--- a/ext/jpeg/gstjpegdec.c
+++ b/ext/jpeg/gstjpegdec.c
@@ -82,6 +82,7 @@ GST_STATIC_PAD_TEMPLATE ("sink",
GST_DEBUG_CATEGORY_STATIC (jpeg_dec_debug);
#define GST_CAT_DEFAULT jpeg_dec_debug
+GST_DEBUG_CATEGORY_STATIC (GST_CAT_PERFORMANCE);
/* These macros are adapted from videotestsrc.c
* and/or gst-plugins/gst/games/gstvideoimage.c */
@@ -191,6 +192,7 @@ gst_jpeg_dec_class_init (GstJpegDecClass * klass)
GST_DEBUG_FUNCPTR (gst_jpeg_dec_change_state);
GST_DEBUG_CATEGORY_INIT (jpeg_dec_debug, "jpegdec", 0, "JPEG decoder");
+ GST_DEBUG_CATEGORY_GET (GST_CAT_PERFORMANCE, "GST_PERFORMANCE");
}
static boolean
@@ -1057,7 +1059,10 @@ gst_jpeg_dec_chain (GstPad * pad, GstBuffer * buf)
* copy over the data into our final picture buffer, otherwise jpeglib might
* write over the end of a line into the beginning of the next line,
* resulting in blocky artifacts on the left side of the picture. */
- if (r_h != 2 || width % (dec->cinfo.max_h_samp_factor * DCTSIZE) != 0) {
+ if (G_UNLIKELY (r_h != 2
+ || width % (dec->cinfo.max_h_samp_factor * DCTSIZE) != 0)) {
+ GST_CAT_LOG_OBJECT (GST_CAT_PERFORMANCE, dec,
+ "indirect decoding using extra buffer copy");
gst_jpeg_dec_decode_indirect (dec, base, last, width, height, r_v, r_h);
} else {
gst_jpeg_dec_decode_direct (dec, base, last, width, height, r_v);