[FFmpeg-cvslog] Merge commit '755f79f84cbeb5d749fb120e55e0098a2d7663a0'

Clément Bœsch git at videolan.org
Sun Jun 19 13:42:39 CEST 2016


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Jun 19 13:34:22 2016 +0200| [222e7d23d0fbcc17fe3d596d768e2aa0fb6e8161] | committer: Clément Bœsch

Merge commit '755f79f84cbeb5d749fb120e55e0098a2d7663a0'

* commit '755f79f84cbeb5d749fb120e55e0098a2d7663a0':
  h264_refs: make the H264Context const where possible

ff_h264_decode_ref_pic_list_reordering() and h264_initialise_ref_list()
do not have a const H264Context * as they modify the default_ref inside
that context.

Merged-by: Clément Bœsch <u at pkh.me>

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

 libavcodec/h264_refs.c |   15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index d00ceb8..6de532b 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -75,7 +75,7 @@ static int split_field_copy(H264Ref *dest, H264Picture *src, int parity, int id_
 }
 
 static int build_def_list(H264Ref *def, int def_len,
-                          H264Picture **in, int len, int is_long, int sel)
+                          H264Picture * const *in, int len, int is_long, int sel)
 {
     int  i[2] = { 0 };
     int index = 0;
@@ -100,7 +100,8 @@ static int build_def_list(H264Ref *def, int def_len,
     return index;
 }
 
-static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limit, int dir)
+static int add_sorted(H264Picture **sorted, H264Picture * const *src,
+                      int len, int limit, int dir)
 {
     int i, best_poc;
     int out_i = 0;
@@ -122,9 +123,9 @@ static int add_sorted(H264Picture **sorted, H264Picture **src, int len, int limi
     return out_i;
 }
 
-static int mismatches_ref(H264Context *h, H264Picture *pic)
+static int mismatches_ref(const H264Context *h, const H264Picture *pic)
 {
-    AVFrame *f = pic->f;
+    const AVFrame *f = pic->f;
     return (h->cur_pic_ptr->f->width  != f->width ||
             h->cur_pic_ptr->f->height != f->height ||
             h->cur_pic_ptr->f->format != f->format);
@@ -215,7 +216,7 @@ static void h264_initialise_ref_list(H264Context *h, H264SliceContext *sl)
 /**
  * print short term list
  */
-static void print_short_term(H264Context *h)
+static void print_short_term(const H264Context *h)
 {
     uint32_t i;
     if (h->avctx->debug & FF_DEBUG_MMCO) {
@@ -231,7 +232,7 @@ static void print_short_term(H264Context *h)
 /**
  * print long term list
  */
-static void print_long_term(H264Context *h)
+static void print_long_term(const H264Context *h)
 {
     uint32_t i;
     if (h->avctx->debug & FF_DEBUG_MMCO) {
@@ -256,7 +257,7 @@ static void print_long_term(H264Context *h)
  * @return frame number (short term) or long term index of picture
  *         described by pic_num
  */
-static int pic_num_extract(H264Context *h, int pic_num, int *structure)
+static int pic_num_extract(const H264Context *h, int pic_num, int *structure)
 {
     *structure = h->picture_structure;
     if (FIELD_PICTURE(h)) {


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

diff --cc libavcodec/h264_refs.c
index d00ceb8,395c240..6de532b
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@@ -122,18 -120,9 +123,18 @@@ static int add_sorted(H264Picture **sor
      return out_i;
  }
  
- static int mismatches_ref(H264Context *h, H264Picture *pic)
 -static void h264_initialise_ref_list(const H264Context *h, H264SliceContext *sl)
++static int mismatches_ref(const H264Context *h, const H264Picture *pic)
 +{
-     AVFrame *f = pic->f;
++    const AVFrame *f = pic->f;
 +    return (h->cur_pic_ptr->f->width  != f->width ||
 +            h->cur_pic_ptr->f->height != f->height ||
 +            h->cur_pic_ptr->f->format != f->format);
 +}
 +
 +static void h264_initialise_ref_list(H264Context *h, H264SliceContext *sl)
  {
      int i, len;
 +    int j;
  
      if (sl->slice_type_nos == AV_PICTURE_TYPE_B) {
          H264Picture *sorted[32];



More information about the ffmpeg-cvslog mailing list