[FFmpeg-cvslog] hevc/intra_pred: simplify neighboring sample derivation

Anton Khirnov git at videolan.org
Mon May 19 15:09:58 CEST 2014


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat May 17 22:30:42 2014 +0200| [c9f8809ee4c576d5833865039bc1c85754448f67] | committer: Anton Khirnov

hevc/intra_pred: simplify neighboring sample derivation

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c9f8809ee4c576d5833865039bc1c85754448f67
---

 libavcodec/hevcpred_template.c |   16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/libavcodec/hevcpred_template.c b/libavcodec/hevcpred_template.c
index 8e80f81..53b9c59 100644
--- a/libavcodec/hevcpred_template.c
+++ b/libavcodec/hevcpred_template.c
@@ -159,10 +159,10 @@ do {                                  \
         }
     }
     if (cand_bottom_left) {
-        for (i = size + bottom_left_size; i < (size << 1); i++)
-            left[i] = POS(-1, size + bottom_left_size - 1);
-        for (i = size + bottom_left_size - 1; i >= size; i--)
+        for (i = size; i < size + bottom_left_size; i++)
             left[i] = POS(-1, i);
+        EXTEND(left + size + bottom_left_size, POS(-1, size + bottom_left_size - 1),
+               size - bottom_left_size);
     }
     if (cand_left)
         for (i = size - 1; i >= 0; i--)
@@ -172,13 +172,11 @@ do {                                  \
         top[-1]  = left[-1];
     }
     if (cand_up)
-        for (i = size - 1; i >= 0; i--)
-            top[i] = POS(i, -1);
+        memcpy(top, src - stride, size * sizeof(pixel));
     if (cand_up_right) {
-        for (i = size + top_right_size; i < (size << 1); i++)
-            top[i] = POS(size + top_right_size - 1, -1);
-        for (i = size + top_right_size - 1; i >= size; i--)
-            top[i] = POS(i, -1);
+        memcpy(top + size, src - stride + size, size * sizeof(pixel));
+        EXTEND(top + size + top_right_size, POS(size + top_right_size - 1, -1),
+               size - top_right_size);
     }
 
     if (s->pps->constrained_intra_pred_flag == 1) {



More information about the ffmpeg-cvslog mailing list