From: Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
To: linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Nicolas Dufresne
<nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>,
Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
Jonas Karlman <jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org>,
Tomasz Figa <tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Hans Verkuil
<hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>,
kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org,
Ezequiel Garcia
<ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
Subject: [PATCH 04/10] rockchip/vpu: Cleanup macroblock alignment
Date: Tue, 5 Feb 2019 17:24:11 -0300 [thread overview]
Message-ID: <20190205202417.16555-5-ezequiel@collabora.com> (raw)
In-Reply-To: <20190205202417.16555-1-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
We need to make the macrobock alignment generic, in order
to support multiple codecs.
Signed-off-by: Ezequiel Garcia <ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
---
.../media/rockchip/vpu/rockchip_vpu_enc.c | 20 ++++++++-----------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c b/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c
index 4451bb2dc3d7..ae1ff3d9b9d2 100644
--- a/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c
+++ b/drivers/staging/media/rockchip/vpu/rockchip_vpu_enc.c
@@ -203,8 +203,8 @@ vidioc_try_fmt_cap_mplane(struct file *file, void *priv, struct v4l2_format *f)
fmt->frmsize.min_height,
fmt->frmsize.max_height);
/* Round up to macroblocks. */
- pix_mp->width = round_up(pix_mp->width, JPEG_MB_DIM);
- pix_mp->height = round_up(pix_mp->height, JPEG_MB_DIM);
+ pix_mp->width = round_up(pix_mp->width, fmt->frmsize.step_width);
+ pix_mp->height = round_up(pix_mp->height, fmt->frmsize.step_height);
/*
* For compressed formats the application can specify
@@ -248,8 +248,8 @@ vidioc_try_fmt_out_mplane(struct file *file, void *priv, struct v4l2_format *f)
ctx->vpu_dst_fmt->frmsize.min_height,
ctx->vpu_dst_fmt->frmsize.max_height);
/* Round up to macroblocks. */
- width = round_up(width, JPEG_MB_DIM);
- height = round_up(height, JPEG_MB_DIM);
+ width = round_up(width, ctx->vpu_dst_fmt->frmsize.step_width);
+ height = round_up(height, ctx->vpu_dst_fmt->frmsize.step_height);
/* Fill remaining fields */
v4l2_fill_pixfmt_mp(pix_mp, fmt->fourcc, width, height);
@@ -338,10 +338,8 @@ vidioc_s_fmt_out_mplane(struct file *file, void *priv, struct v4l2_format *f)
ctx->dst_fmt.height = pix_mp->height;
vpu_debug(0, "OUTPUT codec mode: %d\n", ctx->vpu_src_fmt->codec_mode);
- vpu_debug(0, "fmt - w: %d, h: %d, mb - w: %d, h: %d\n",
- pix_mp->width, pix_mp->height,
- JPEG_MB_WIDTH(pix_mp->width),
- JPEG_MB_HEIGHT(pix_mp->height));
+ vpu_debug(0, "fmt - w: %d, h: %d\n",
+ pix_mp->width, pix_mp->height);
return 0;
}
@@ -380,10 +378,8 @@ vidioc_s_fmt_cap_mplane(struct file *file, void *priv, struct v4l2_format *f)
ctx->dst_fmt = *pix_mp;
vpu_debug(0, "CAPTURE codec mode: %d\n", ctx->vpu_dst_fmt->codec_mode);
- vpu_debug(0, "fmt - w: %d, h: %d, mb - w: %d, h: %d\n",
- pix_mp->width, pix_mp->height,
- JPEG_MB_WIDTH(pix_mp->width),
- JPEG_MB_HEIGHT(pix_mp->height));
+ vpu_debug(0, "fmt - w: %d, h: %d\n",
+ pix_mp->width, pix_mp->height);
/*
* Current raw format might have become invalid with newly
--
2.20.1
next prev parent reply other threads:[~2019-02-05 20:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-05 20:24 [PATCH v1 00/10] Add MPEG-2 decoding to Rockchip VPU Ezequiel Garcia
[not found] ` <20190205202417.16555-1-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-02-05 20:24 ` [PATCH 01/10] media: Introduce helpers to fill pixel format structs Ezequiel Garcia
[not found] ` <20190205202417.16555-2-ezequiel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-02-06 10:43 ` Hans Verkuil
[not found] ` <79ad7cf7-90d5-9542-06ea-e28ddeb14e94-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2019-02-06 16:22 ` Ezequiel Garcia
[not found] ` <85ff24016b4d4b55a1a02f1aee6b42dbbaf2279a.camel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org>
2019-02-06 16:36 ` Hans Verkuil
[not found] ` <d1ea8698-e4c6-a826-0820-b8395c8c2a6f-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2019-02-20 6:53 ` Tomasz Figa
[not found] ` <CAAFQd5DLTOJ0kheFdxzTV7Hrtc5MpG4Utn00HgNh06d+h_qJfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2019-02-20 8:39 ` Hans Verkuil
[not found] ` <ea53ac3d-a337-d725-3317-1cef42481820-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org>
2019-02-21 19:26 ` Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 02/10] rockchip/vpu: Use pixel format helpers Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 03/10] rockchip/vpu: Use v4l2_m2m_buf_copy_data Ezequiel Garcia
2019-02-05 20:24 ` Ezequiel Garcia [this message]
2019-02-05 20:24 ` [PATCH 05/10] rockchip/vpu: Cleanup JPEG bounce buffer management Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 06/10] rockchip/vpu: Open-code media controller register Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 07/10] rockchip/vpu: Support the Request API Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 08/10] rockchip/vpu: Add decoder boilerplate Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 09/10] rockchip/vpu: Add support for non-standard controls Ezequiel Garcia
2019-02-05 20:24 ` [PATCH 10/10] rockchip/vpu: Add support for MPEG-2 decoding Ezequiel Garcia
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190205202417.16555-5-ezequiel@collabora.com \
--to=ezequiel-zgy8ohtn/8qb+jhodadfcq@public.gmane.org \
--cc=hans.verkuil-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org \
--cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
--cc=jonas-uIzNG4q0ceqzQB+pC5nmwQ@public.gmane.org \
--cc=kernel-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=linux-media-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=nicolas.dufresne-ZGY8ohtN/8qB+jHODAdFcQ@public.gmane.org \
--cc=tfiga-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox