summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorJanne Grunau <janne-libav@jannau.net>2014-01-20 18:16:54 +0100
committerJanne Grunau <janne-libav@jannau.net>2014-01-22 13:44:28 +0100
commitea49f60523c4f4c43cb06a35166b44478d473e51 (patch)
tree5f84d6ec09227fab714eee8317221204c89de39b /libavcodec/h264.c
parent8267f9363532b23b3b8b4e27491ee2d412a8aec3 (diff)
h264: skip chroma edges at the picture boundary while deblocking 4:4:4
This handles macroblock edges for the chroma components in the same way as for the luma compoment for 4:4:4 streams. The Spec explicitly states that the deblocking filter is not applied to edges at the boundary of the picture. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 4b10a68f03..5069e4a456 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -2361,17 +2361,19 @@ static av_always_inline void xchg_mb_border(H264Context *h, uint8_t *src_y,
}
if (simple || !CONFIG_GRAY || !(h->flags & CODEC_FLAG_GRAY)) {
if (chroma444) {
- if (deblock_topleft) {
- XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
- XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
- }
- XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
- XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
- XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
- XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
- if (h->mb_x + 1 < h->mb_width) {
- XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
- XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
+ if (deblock_top) {
+ if (deblock_topleft) {
+ XCHG(top_border_m1 + (24 << pixel_shift), src_cb - (7 << pixel_shift), 1);
+ XCHG(top_border_m1 + (40 << pixel_shift), src_cr - (7 << pixel_shift), 1);
+ }
+ XCHG(top_border + (16 << pixel_shift), src_cb + (1 << pixel_shift), xchg);
+ XCHG(top_border + (24 << pixel_shift), src_cb + (9 << pixel_shift), 1);
+ XCHG(top_border + (32 << pixel_shift), src_cr + (1 << pixel_shift), xchg);
+ XCHG(top_border + (40 << pixel_shift), src_cr + (9 << pixel_shift), 1);
+ if (h->mb_x + 1 < h->mb_width) {
+ XCHG(h->top_borders[top_idx][h->mb_x + 1] + (16 << pixel_shift), src_cb + (17 << pixel_shift), 1);
+ XCHG(h->top_borders[top_idx][h->mb_x + 1] + (32 << pixel_shift), src_cr + (17 << pixel_shift), 1);
+ }
}
} else {
if (deblock_top) {