Lines Matching refs:dither
47 void (*func) (GstVideoDither * dither, gpointer pixels, guint x, guint y,
58 dither_none_u8_mask (GstVideoDither * dither, gpointer pixels, guint x, guint y, in dither_none_u8_mask() argument
63 video_orc_dither_none_4u8_mask (p + (x * 4), dither->orc_mask32, width); in dither_none_u8_mask()
67 dither_none_u16_mask (GstVideoDither * dither, gpointer pixels, guint x, in dither_none_u16_mask() argument
72 video_orc_dither_none_4u16_mask (p + (x * 4), dither->orc_mask64, width); in dither_none_u16_mask()
76 dither_verterr_u8 (GstVideoDither * dither, gpointer pixels, guint x, guint y, in dither_verterr_u8() argument
80 guint16 *e = dither->errors; in dither_verterr_u8()
86 dither->orc_mask64, width); in dither_verterr_u8()
90 dither_verterr_u16 (GstVideoDither * dither, gpointer pixels, guint x, guint y, in dither_verterr_u16() argument
94 guint16 *e = dither->errors; in dither_verterr_u16()
101 guint16 *m = dither->mask; in dither_verterr_u16()
118 dither_floyd_steinberg_u8 (GstVideoDither * dither, gpointer pixels, guint x, in dither_floyd_steinberg_u8() argument
122 guint16 *e = dither->errors; in dither_floyd_steinberg_u8()
132 guint16 *m = dither->mask, mp; in dither_floyd_steinberg_u8()
149 dither->orc_mask64, width); in dither_floyd_steinberg_u8()
154 dither_floyd_steinberg_u16 (GstVideoDither * dither, gpointer pixels, guint x, in dither_floyd_steinberg_u16() argument
158 guint16 *e = dither->errors; in dither_floyd_steinberg_u16()
165 guint16 *m = dither->mask, mp; in dither_floyd_steinberg_u16()
183 dither_sierra_lite_u8 (GstVideoDither * dither, gpointer pixels, guint x, in dither_sierra_lite_u8() argument
187 guint16 *e = dither->errors; in dither_sierra_lite_u8()
189 guint16 *m = dither->mask, mp; in dither_sierra_lite_u8()
209 dither_sierra_lite_u16 (GstVideoDither * dither, gpointer pixels, guint x, in dither_sierra_lite_u16() argument
213 guint16 *e = dither->errors; in dither_sierra_lite_u16()
215 guint16 *m = dither->mask, mp; in dither_sierra_lite_u16()
254 dither_ordered_u8 (GstVideoDither * dither, gpointer pixels, guint x, guint y, in dither_ordered_u8() argument
258 guint8 *c = (guint8 *) dither->errors + ((y & 15) * width + (x & 15)) * 4; in dither_ordered_u8()
264 dither_ordered_u8_mask (GstVideoDither * dither, gpointer pixels, guint x, in dither_ordered_u8_mask() argument
268 guint16 *c = (guint16 *) dither->errors + ((y & 15) * width + (x & 15)) * 4; in dither_ordered_u8_mask()
270 video_orc_dither_ordered_4u8_mask (p, c, dither->orc_mask64, width); in dither_ordered_u8_mask()
274 dither_ordered_u16_mask (GstVideoDither * dither, gpointer pixels, guint x, in dither_ordered_u16_mask() argument
278 guint16 *c = (guint16 *) dither->errors + ((y & 15) * width + (x & 15)) * 4; in dither_ordered_u16_mask()
280 video_orc_dither_ordered_4u16_mask (p, c, dither->orc_mask64, width); in dither_ordered_u16_mask()
284 alloc_errors (GstVideoDither * dither, guint lines) in alloc_errors() argument
288 width = dither->width; in alloc_errors()
289 n_comp = dither->n_comp; in alloc_errors()
291 dither->errors = g_malloc0 (sizeof (guint16) * (width + 8) * n_comp * lines); in alloc_errors()
295 setup_bayer (GstVideoDither * dither) in setup_bayer() argument
300 width = dither->width; in setup_bayer()
301 shift = dither->shift; in setup_bayer()
302 n_comp = dither->n_comp; in setup_bayer()
304 if (dither->depth == 8) { in setup_bayer()
305 if (dither->flags & GST_VIDEO_DITHER_FLAG_QUANTIZE) { in setup_bayer()
306 dither->func = dither_ordered_u8_mask; in setup_bayer()
309 dither->func = dither_ordered_u8; in setup_bayer()
313 dither->func = dither_ordered_u16_mask; in setup_bayer()
317 alloc_errors (dither, 16); in setup_bayer()
321 guint8 *p = (guint8 *) dither->errors + (n_comp * width * i), v; in setup_bayer()
333 guint16 *p = (guint16 *) dither->errors + (n_comp * width * i), v; in setup_bayer()
380 GstVideoDither *dither; in gst_video_dither_new() local
383 dither = g_slice_new0 (GstVideoDither); in gst_video_dither_new()
384 dither->method = method; in gst_video_dither_new()
385 dither->flags = flags; in gst_video_dither_new()
386 dither->format = format; in gst_video_dither_new()
387 dither->width = width; in gst_video_dither_new()
389 dither->n_comp = 4; in gst_video_dither_new()
394 dither->depth = 8; in gst_video_dither_new()
398 dither->depth = 16; in gst_video_dither_new()
401 g_slice_free (GstVideoDither, dither); in gst_video_dither_new()
410 dither->shift[i] = count_power (q); in gst_video_dither_new()
411 dither->mask[i] = (1 << dither->shift[i]) - 1; in gst_video_dither_new()
412 GST_DEBUG ("%d: quant %d shift %d mask %08x", i, q, dither->shift[i], in gst_video_dither_new()
413 dither->mask[i]); in gst_video_dither_new()
414 dither->orc_mask64 = in gst_video_dither_new()
415 (dither->orc_mask64 << 16) | GUINT16_FROM_BE (dither->mask[i]); in gst_video_dither_new()
416 dither->orc_mask32 = (dither->orc_mask32 << 8) | (guint8) dither->mask[i]; in gst_video_dither_new()
418 dither->orc_mask64 = GUINT64_FROM_BE (dither->orc_mask64); in gst_video_dither_new()
419 dither->orc_mask32 = GUINT32_FROM_BE (dither->orc_mask32); in gst_video_dither_new()
420 GST_DEBUG ("mask64 %08" G_GINT64_MODIFIER "x", (guint64) dither->orc_mask64); in gst_video_dither_new()
421 GST_DEBUG ("mask32 %08x", dither->orc_mask32); in gst_video_dither_new()
425 if (dither->flags & GST_VIDEO_DITHER_FLAG_QUANTIZE) in gst_video_dither_new()
426 if (dither->depth == 8) in gst_video_dither_new()
427 dither->func = dither_none_u8_mask; in gst_video_dither_new()
429 dither->func = dither_none_u16_mask; in gst_video_dither_new()
431 dither->func = NULL; in gst_video_dither_new()
434 alloc_errors (dither, 1); in gst_video_dither_new()
435 if (dither->depth == 8) { in gst_video_dither_new()
436 dither->func = dither_verterr_u8; in gst_video_dither_new()
438 dither->func = dither_verterr_u16; in gst_video_dither_new()
441 alloc_errors (dither, 1); in gst_video_dither_new()
442 if (dither->depth == 8) { in gst_video_dither_new()
443 dither->func = dither_floyd_steinberg_u8; in gst_video_dither_new()
445 dither->func = dither_floyd_steinberg_u16; in gst_video_dither_new()
448 alloc_errors (dither, 1); in gst_video_dither_new()
449 if (dither->depth == 8) { in gst_video_dither_new()
450 dither->func = dither_sierra_lite_u8; in gst_video_dither_new()
452 dither->func = dither_sierra_lite_u16; in gst_video_dither_new()
455 setup_bayer (dither); in gst_video_dither_new()
458 return dither; in gst_video_dither_new()
468 gst_video_dither_free (GstVideoDither * dither) in gst_video_dither_free() argument
470 g_return_if_fail (dither != NULL); in gst_video_dither_free()
472 g_free (dither->errors); in gst_video_dither_free()
473 g_slice_free (GstVideoDither, dither); in gst_video_dither_free()
489 gst_video_dither_line (GstVideoDither * dither, gpointer line, guint x, guint y, in gst_video_dither_line() argument
492 g_return_if_fail (dither != NULL); in gst_video_dither_line()
493 g_return_if_fail (x + width <= dither->width); in gst_video_dither_line()
495 if (dither->func) in gst_video_dither_line()
496 dither->func (dither, line, x, y, width); in gst_video_dither_line()