From patchwork Tue Jan 3 22:02:50 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 6039 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C9FDC23F7F for ; Tue, 3 Jan 2012 22:03:08 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id BC5A3A18078 for ; Tue, 3 Jan 2012 22:03:08 +0000 (UTC) Received: by mail-ey0-f180.google.com with SMTP id c11so16120253eaa.11 for ; Tue, 03 Jan 2012 14:03:08 -0800 (PST) Received: by 10.204.133.207 with SMTP id g15mr12090066bkt.17.1325628188518; Tue, 03 Jan 2012 14:03:08 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs352493bkc; Tue, 3 Jan 2012 14:03:08 -0800 (PST) Received: by 10.236.128.138 with SMTP id f10mr71124197yhi.2.1325628186341; Tue, 03 Jan 2012 14:03:06 -0800 (PST) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id a16si12950547ani.0.2012.01.03.14.03.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jan 2012 14:03:06 -0800 (PST) Received-SPF: pass (google.com: domain of robdclark@gmail.com designates 209.85.213.178 as permitted sender) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=pass (google.com: domain of robdclark@gmail.com designates 209.85.213.178 as permitted sender) smtp.mail=robdclark@gmail.com; dkim=pass (test mode) header.i=@gmail.com Received: by mail-yx0-f178.google.com with SMTP id m5so9594587yen.37 for ; Tue, 03 Jan 2012 14:03:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=gsA6G690T+OBN8Rd7ZYULkFQLbRKRQYYlZU+MjbNRbA=; b=QqSoCyRjqK5P0+ymeoeUrpLrmUnIcaYodMmEHKsKRLJRVPfuqnDar/NjW9HKrWY1UQ hRvvwUXA5jA8ZdHjVuJxvWczfg25I8QIfzopkV89kuz/qQUVsu3g8c0I74LrOS4m7eHQ d+EqiUsEQ11S+pqSjUurUI8+NVWnYsZl9a0bo= Received: by 10.236.155.104 with SMTP id i68mr7614172yhk.37.1325628185920; Tue, 03 Jan 2012 14:03:05 -0800 (PST) Received: from localhost (dragon.ti.com. [192.94.94.33]) by mx.google.com with ESMTPS id b36sm39962696yhj.22.2012.01.03.14.03.05 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 03 Jan 2012 14:03:05 -0800 (PST) Sender: Rob Clark From: Rob Clark To: patches@linaro.org Cc: Rob Clark Subject: [PATCH 14/19] dvdspu: cleanup debug code Date: Tue, 3 Jan 2012 16:02:50 -0600 Message-Id: <1325628171-4803-7-git-send-email-rob@ti.com> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1325628171-4803-1-git-send-email-rob@ti.com> References: <1325628171-4803-1-git-send-email-rob@ti.com> Clean up debug code for drawing highlight rects which wasn't even compiling previously. TODO: might be nice if this could be controlled by properties or env variables to make it possible to enable the debug code at runtime. --- See: https://bugzilla.gnome.org/show_bug.cgi?id=667223 gst/dvdspu/gstspu-vobsub-render.c | 70 ++++++++++++++----------------------- 1 files changed, 26 insertions(+), 44 deletions(-) diff --git a/gst/dvdspu/gstspu-vobsub-render.c b/gst/dvdspu/gstspu-vobsub-render.c index 66abd9f..83943e9 100644 --- a/gst/dvdspu/gstspu-vobsub-render.c +++ b/gst/dvdspu/gstspu-vobsub-render.c @@ -392,6 +392,27 @@ gstspu_vobsub_clear_comp_buffers (SpuState * state) state->vobsub.comp_last_x[1] = -1; } +static void +gstspu_vobsub_draw_highlight (SpuState * state, + GstBuffer * buf, SpuRect *rect) +{ + guint8 *cur; + gint16 pos; + + cur = GST_BUFFER_DATA (buf) + state->Y_stride * rect->top; + for (pos = rect->left + 1; pos < rect->right; pos++) + cur[pos] = (cur[pos] / 2) + 0x8; + cur = GST_BUFFER_DATA (buf) + state->Y_stride * rect->bottom; + for (pos = rect->left + 1; pos < rect->right; pos++) + cur[pos] = (cur[pos] / 2) + 0x8; + cur = GST_BUFFER_DATA (buf) + state->Y_stride * rect->top; + for (pos = rect->top; pos <= rect->bottom; pos++) { + cur[rect->left] = (cur[rect->left] / 2) + 0x8; + cur[rect->right] = (cur[rect->right] / 2) + 0x8; + cur += state->Y_stride; + } +} + void gstspu_vobsub_render (GstDVDSpu * dvdspu, GstBuffer * buf) { @@ -569,50 +590,11 @@ gstspu_vobsub_render (GstDVDSpu * dvdspu, GstBuffer * buf) } /* for debugging purposes, draw a faint rectangle at the edges of the disp_rect */ -#if 0 - do { - guint8 *cur; - gint16 pos; - - cur = GST_BUFFER_DATA (buf) + state->Y_stride * state->vobsub.disp_rect.top; - for (pos = state->vobsub.disp_rect.left + 1; - pos < state->vobsub.disp_rect.right; pos++) - cur[pos] = (cur[pos] / 2) + 0x8; - cur = - GST_BUFFER_DATA (buf) + - state->Y_stride * state->vobsub.disp_rect.bottom; - for (pos = state->vobsub.disp_rect.left + 1; - pos < state->vobsub.disp_rect.right; pos++) - cur[pos] = (cur[pos] / 2) + 0x8; - cur = GST_BUFFER_DATA (buf) + state->Y_stride * state->vobsub.disp_rect.top; - for (pos = state->vobsub.disp_rect.top; - pos <= state->vobsub.disp_rect.bottom; pos++) { - cur[state->vobsub.disp_rect.left] = - (cur[state->vobsub.disp_rect.left] / 2) + 0x8; - cur[state->vobsub.disp_rect.right] = - (cur[state->vobsub.disp_rect.right] / 2) + 0x8; - cur += state->Y_stride; - } - } while (0); -#endif + if (FALSE) { + gstspu_vobsub_draw_highlight (state, buf, &state->vobsub.disp_rect); + } /* For debugging purposes, draw a faint rectangle around the highlight rect */ -#if 0 - if (state->hl_rect.top != -1) { - guint8 *cur; - gint16 pos; - - cur = GST_BUFFER_DATA (buf) + state->Y_stride * state->hl_rect.top; - for (pos = state->hl_rect.left + 1; pos < state->hl_rect.right; pos++) - cur[pos] = (cur[pos] / 2) + 0x8; - cur = GST_BUFFER_DATA (buf) + state->Y_stride * state->hl_rect.bottom; - for (pos = state->hl_rect.left + 1; pos < state->hl_rect.right; pos++) - cur[pos] = (cur[pos] / 2) + 0x8; - cur = GST_BUFFER_DATA (buf) + state->Y_stride * state->hl_rect.top; - for (pos = state->hl_rect.top; pos <= state->hl_rect.bottom; pos++) { - cur[state->hl_rect.left] = (cur[state->hl_rect.left] / 2) + 0x8; - cur[state->hl_rect.right] = (cur[state->hl_rect.right] / 2) + 0x8; - cur += state->Y_stride; - } + if (FALSE && state->vobsub.hl_rect.top != -1) { + gstspu_vobsub_draw_highlight (state, buf, &state->vobsub.hl_rect); } -#endif }