[FFmpeg-cvslog] Merge commit 'c3f0357bdf7d3c542aad2c58b94184b9f56edc41'

James Almer git at videolan.org
Tue Oct 31 17:57:00 EET 2017


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Oct 31 12:48:36 2017 -0300| [b1ab02895b121b92dc3483c79e45eb5ea686f3aa] | committer: James Almer

Merge commit 'c3f0357bdf7d3c542aad2c58b94184b9f56edc41'

* commit 'c3f0357bdf7d3c542aad2c58b94184b9f56edc41':
  hevcdec: move the MD5 context out of HEVCSEIPictureHash back into HEVCContext

Merged-by: James Almer <jamrial at gmail.com>

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

 libavcodec/hevc_sei.h |  3 ---
 libavcodec/hevcdec.c  | 12 ++++++------
 libavcodec/hevcdec.h  |  2 ++
 3 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/libavcodec/hevc_sei.h b/libavcodec/hevc_sei.h
index 8daf2e3f2f..d290aaab53 100644
--- a/libavcodec/hevc_sei.h
+++ b/libavcodec/hevc_sei.h
@@ -23,8 +23,6 @@
 
 #include <stdint.h>
 
-#include "libavutil/md5.h"
-
 #include "get_bits.h"
 
 /**
@@ -60,7 +58,6 @@ typedef enum {
 } HEVC_SEI_Type;
 
 typedef struct HEVCSEIPictureHash {
-    struct AVMD5 *md5_ctx;
     uint8_t       md5[3][16];
     uint8_t is_md5;
 } HEVCSEIPictureHash;
diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
index 2e4add2ae3..675025b211 100644
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@ -3035,7 +3035,7 @@ static int verify_md5(HEVCContext *s, AVFrame *frame)
         int h = (i == 1 || i == 2) ? (height >> desc->log2_chroma_h) : height;
         uint8_t md5[16];
 
-        av_md5_init(s->sei.picture_hash.md5_ctx);
+        av_md5_init(s->md5_ctx);
         for (j = 0; j < h; j++) {
             const uint8_t *src = frame->data[i] + j * frame->linesize[i];
 #if HAVE_BIGENDIAN
@@ -3045,9 +3045,9 @@ static int verify_md5(HEVCContext *s, AVFrame *frame)
                 src = s->checksum_buf;
             }
 #endif
-            av_md5_update(s->sei.picture_hash.md5_ctx, src, w << pixel_shift);
+            av_md5_update(s->md5_ctx, src, w << pixel_shift);
         }
-        av_md5_final(s->sei.picture_hash.md5_ctx, md5);
+        av_md5_final(s->md5_ctx, md5);
 
         if (!memcmp(md5, s->sei.picture_hash.md5[i], 16)) {
             av_log   (s->avctx, AV_LOG_DEBUG, "plane %d - correct ", i);
@@ -3200,7 +3200,7 @@ static av_cold int hevc_decode_free(AVCodecContext *avctx)
 
     pic_arrays_free(s);
 
-    av_freep(&s->sei.picture_hash.md5_ctx);
+    av_freep(&s->md5_ctx);
 
     av_freep(&s->cabac_state);
 
@@ -3275,8 +3275,8 @@ static av_cold int hevc_init_context(AVCodecContext *avctx)
 
     s->max_ra = INT_MAX;
 
-    s->sei.picture_hash.md5_ctx = av_md5_alloc();
-    if (!s->sei.picture_hash.md5_ctx)
+    s->md5_ctx = av_md5_alloc();
+    if (!s->md5_ctx)
         goto fail;
 
     ff_bswapdsp_init(&s->bdsp);
diff --git a/libavcodec/hevcdec.h b/libavcodec/hevcdec.h
index 1bfdaef73f..ef918f4fb2 100644
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@ -26,6 +26,7 @@
 #include <stdatomic.h>
 
 #include "libavutil/buffer.h"
+#include "libavutil/md5.h"
 
 #include "avcodec.h"
 #include "bswapdsp.h"
@@ -406,6 +407,7 @@ typedef struct HEVCContext {
 
     HEVCParamSets ps;
     HEVCSEI sei;
+    struct AVMD5 *md5_ctx;
 
     AVBufferPool *tab_mvf_pool;
     AVBufferPool *rpl_tab_pool;


======================================================================

diff --cc libavcodec/hevcdec.c
index 2e4add2ae3,69d5908551..675025b211
--- a/libavcodec/hevcdec.c
+++ b/libavcodec/hevcdec.c
@@@ -3200,14 -2893,9 +3200,14 @@@ static av_cold int hevc_decode_free(AVC
  
      pic_arrays_free(s);
  
-     av_freep(&s->sei.picture_hash.md5_ctx);
+     av_freep(&s->md5_ctx);
  
 -    av_frame_free(&s->tmp_frame);
 +    av_freep(&s->cabac_state);
 +
 +    for (i = 0; i < 3; i++) {
 +        av_freep(&s->sao_pixel_buffer_h[i]);
 +        av_freep(&s->sao_pixel_buffer_v[i]);
 +    }
      av_frame_free(&s->output_frame);
  
      for (i = 0; i < FF_ARRAY_ELEMS(s->DPB); i++) {
diff --cc libavcodec/hevcdec.h
index 1bfdaef73f,7adb826e72..ef918f4fb2
--- a/libavcodec/hevcdec.h
+++ b/libavcodec/hevcdec.h
@@@ -23,9 -23,11 +23,10 @@@
  #ifndef AVCODEC_HEVCDEC_H
  #define AVCODEC_HEVCDEC_H
  
 -#include <stddef.h>
 -#include <stdint.h>
 +#include <stdatomic.h>
  
  #include "libavutil/buffer.h"
+ #include "libavutil/md5.h"
  
  #include "avcodec.h"
  #include "bswapdsp.h"



More information about the ffmpeg-cvslog mailing list