Mailinglist Archive: radeonhd (365 mails)
| < Previous | Next > |
[radeonhd] [PATCH] Fix blurry Xv image
- From: Yang Zhao <yang@xxxxxxxxxx>
- Date: Tue, 3 Mar 2009 18:03:22 -0800
- Message-id: <40a7b1aa0903031803p3c70c44brf9245b4060b188dd@xxxxxxxxxxxxxx>
Hi,
The attached patch fixes the issue of blurry images under Xv, compared
to unaccelerated rendering.
The texture sampler for CbCr used to be configured to use bilinear
interpolation when upscaling. This results in a smoothing of the
chroma channels, and is perceived as being blurry when a lot of sharp
changes in colour is present. Simply flip the bits to use
nearest-point interpolation instead.
Cheers,
--
Yang Zhao
http://yangman.ca
From 077b48201112f607191f835f6aeaafc0dc22fe08 Mon Sep 17 00:00:00 2001
From: Yang Zhao <yang@xxxxxxxxxx>
Date: Tue, 3 Mar 2009 17:21:20 -0800
Subject: [PATCH] R6xx/R7xx Xv: Do not smooth when sampling CbCr
Blinear interpolation on CbCr values when up-scaling introduces
blurring that's especially noticible with a lot of sharp colour changes.
Change the sampler to use nearest-point interpolation instead, which
should be more accurate.
---
src/r600_textured_videofuncs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/r600_textured_videofuncs.c b/src/r600_textured_videofuncs.c
index 3503e2e..0481d32 100644
--- a/src/r600_textured_videofuncs.c
+++ b/src/r600_textured_videofuncs.c
@@ -286,8 +286,8 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, struct
RHDPortPriv *pPriv)
tex_res.mip_base = accel_state->src_mc_addr[0] + uv_offset;
set_tex_resource (pScrn, accel_state->ib, &tex_res);
- // xxx: switch to bicubic
- tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR;
+ /* Don't smooth magnification */
+ tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT;
tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_BILINEAR;
tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE;
@@ -397,8 +397,8 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, struct
RHDPortPriv *pPriv)
tex_res.mip_base = accel_state->src_mc_addr[0];
set_tex_resource (pScrn, accel_state->ib, &tex_res);
- // xxx: switch to bicubic
- tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR;
+ /* Don't smooth magnification */
+ tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT;
tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_BILINEAR;
tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE;
--
1.6.0.6
The attached patch fixes the issue of blurry images under Xv, compared
to unaccelerated rendering.
The texture sampler for CbCr used to be configured to use bilinear
interpolation when upscaling. This results in a smoothing of the
chroma channels, and is perceived as being blurry when a lot of sharp
changes in colour is present. Simply flip the bits to use
nearest-point interpolation instead.
Cheers,
--
Yang Zhao
http://yangman.ca
From 077b48201112f607191f835f6aeaafc0dc22fe08 Mon Sep 17 00:00:00 2001
From: Yang Zhao <yang@xxxxxxxxxx>
Date: Tue, 3 Mar 2009 17:21:20 -0800
Subject: [PATCH] R6xx/R7xx Xv: Do not smooth when sampling CbCr
Blinear interpolation on CbCr values when up-scaling introduces
blurring that's especially noticible with a lot of sharp colour changes.
Change the sampler to use nearest-point interpolation instead, which
should be more accurate.
---
src/r600_textured_videofuncs.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/r600_textured_videofuncs.c b/src/r600_textured_videofuncs.c
index 3503e2e..0481d32 100644
--- a/src/r600_textured_videofuncs.c
+++ b/src/r600_textured_videofuncs.c
@@ -286,8 +286,8 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, struct
RHDPortPriv *pPriv)
tex_res.mip_base = accel_state->src_mc_addr[0] + uv_offset;
set_tex_resource (pScrn, accel_state->ib, &tex_res);
- // xxx: switch to bicubic
- tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR;
+ /* Don't smooth magnification */
+ tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT;
tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_BILINEAR;
tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE;
@@ -397,8 +397,8 @@ R600DisplayTexturedVideo(ScrnInfoPtr pScrn, struct
RHDPortPriv *pPriv)
tex_res.mip_base = accel_state->src_mc_addr[0];
set_tex_resource (pScrn, accel_state->ib, &tex_res);
- // xxx: switch to bicubic
- tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_BILINEAR;
+ /* Don't smooth magnification */
+ tex_samp.xy_mag_filter = SQ_TEX_XY_FILTER_POINT;
tex_samp.xy_min_filter = SQ_TEX_XY_FILTER_BILINEAR;
tex_samp.z_filter = SQ_TEX_Z_FILTER_NONE;
--
1.6.0.6
| < Previous | Next > |