[FFmpeg-cvslog] Fix partially hidden macroblocks for 10-bit DNxHD.
Joseph Artsimovich
git at videolan.org
Thu Aug 23 21:11:00 CEST 2012
ffmpeg | branch: master | Joseph Artsimovich <joseph at mirriad.com> | Thu Aug 23 14:51:28 2012 +0100| [628e6d0164febc8e69b0f10dfa487e8a2dd1a28a] | committer: Michael Niedermayer
Fix partially hidden macroblocks for 10-bit DNxHD.
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=628e6d0164febc8e69b0f10dfa487e8a2dd1a28a
---
libavcodec/dnxhdenc.c | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c
index 04284e3..97013f6 100644
--- a/libavcodec/dnxhdenc.c
+++ b/libavcodec/dnxhdenc.c
@@ -71,13 +71,21 @@ static void dnxhd_8bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t
static av_always_inline void dnxhd_10bit_get_pixels_8x4_sym(DCTELEM *restrict block, const uint8_t *pixels, int line_size)
{
int i;
-
- block += 32;
+ const uint16_t* pixels16 = pixels;
+ line_size >>= 1;
for (i = 0; i < 4; i++) {
- memcpy(block + i * 8, pixels + i * line_size, 8 * sizeof(*block));
- memcpy(block - (i+1) * 8, pixels + i * line_size, 8 * sizeof(*block));
+ block[0] = pixels16[0]; block[1] = pixels16[1];
+ block[2] = pixels16[2]; block[3] = pixels16[3];
+ block[4] = pixels16[4]; block[5] = pixels16[5];
+ block[6] = pixels16[6]; block[7] = pixels16[7];
+ pixels16 += line_size;
+ block += 8;
}
+ memcpy(block, block - 8, sizeof(*block) * 8);
+ memcpy(block + 8, block - 16, sizeof(*block) * 8);
+ memcpy(block + 16, block - 24, sizeof(*block) * 8);
+ memcpy(block + 24, block - 32, sizeof(*block) * 8);
}
static int dnxhd_10bit_dct_quantize(MpegEncContext *ctx, DCTELEM *block,
More information about the ffmpeg-cvslog
mailing list