]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit 'd82f188504410fdfa446c5682c128c31bb5851a4'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Oct 2012 12:10:44 +0000 (14:10 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 24 Oct 2012 12:10:44 +0000 (14:10 +0200)
* commit 'd82f188504410fdfa446c5682c128c31bb5851a4':
  Remove need for padding in av_memcpy_backptr()

Conflicts:
libavutil/lzo.h

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavutil/lzo.c
libavutil/lzo.h

diff --cc libavutil/lzo.c
index c76d9a86d32adefde204788cc839cc10662fb55a,c17d32f3625dc488d037073d6e28f03eec58040e..47fc767a0640ed0e4618e50d37bbb459070c27bb
@@@ -129,16 -129,17 +129,17 @@@ static inline void copy_backptr(LZOCont
  static inline void memcpy_backptr(uint8_t *dst, int back, int cnt)
  {
      const uint8_t *src = &dst[-back];
 -    if (back == 1) {
 +    if (back <= 1) {
          memset(dst, *src, cnt);
      } else {
- #ifdef OUTBUF_PADDED
-         AV_COPY16U(dst,     src);
-         AV_COPY16U(dst + 2, src + 2);
-         src += 4;
-         dst += 4;
-         cnt -= 4;
-         if (cnt > 0) {
+         if (cnt >= 4) {
+             AV_COPY16U(dst,     src);
+             AV_COPY16U(dst + 2, src + 2);
+             src += 4;
+             dst += 4;
+             cnt -= 4;
+         }
+         if (cnt >= 8) {
              AV_COPY16U(dst,     src);
              AV_COPY16U(dst + 2, src + 2);
              AV_COPY16U(dst + 4, src + 4);
diff --cc libavutil/lzo.h
index 14fb62dd7b1053921263d1ed74efb38a5070a157,a84b9bd15db12dd154bce56e59815e2637d91d67..60b7065b158b53e1720300ecd45e5f1bb8d024cc
@@@ -61,8 -61,8 +61,8 @@@ int av_lzo1x_decode(void *out, int *out
  
  /**
   * @brief deliberately overlapping memcpy implementation
-  * @param dst destination buffer; must be padded with 12 additional bytes
+  * @param dst destination buffer
 - * @param back how many bytes back we start (the initial size of the overlapping window)
 + * @param back how many bytes back we start (the initial size of the overlapping window), must be > 0
   * @param cnt number of bytes to copy, must be >= 0
   *
   * cnt > back is valid, this will copy the bytes we just copied,