]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vp5.c
add 'all' and 'none' options for partitions config
[ffmpeg] / libavcodec / vp5.c
index ce4703b26a2e078e44cb3175d7133cf5a67a006a..8a8c217c0b39892c75d1d9a24bd5c22fd0dcad64 100644 (file)
@@ -4,24 +4,25 @@
  *
  * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>
  *
- * This library is free software; you can redistribute it and/or
+ * This file is part of FFmpeg.
+ *
+ * FFmpeg is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
- * This library is distributed in the hope that it will be useful,
+ * FFmpeg is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include <stdlib.h>
 #include <string.h>
-#include <inttypes.h>
 
 #include "avcodec.h"
 #include "dsputil.h"
@@ -40,10 +41,10 @@ static int vp5_parse_header(vp56_context_t *s, uint8_t *buf, int buf_size,
     int rows, cols;
 
     vp56_init_range_decoder(&s->c, buf, buf_size);
-    s->frames[VP56_FRAME_CURRENT].key_frame = !vp56_rac_get(c);
+    s->framep[VP56_FRAME_CURRENT]->key_frame = !vp56_rac_get(c);
     vp56_rac_get(c);
     vp56_init_dequant(s, vp56_rac_gets(c, 6));
-    if (s->frames[VP56_FRAME_CURRENT].key_frame)
+    if (s->framep[VP56_FRAME_CURRENT]->key_frame)
     {
         vp56_rac_gets(c, 8);
         if(vp56_rac_gets(c, 5) > 5)
@@ -144,7 +145,7 @@ static void vp5_parse_coeff_models(vp56_context_t *s)
             if (vp56_rac_get_prob(c, vp5_dccv_pct[pt][node])) {
                 def_prob[node] = vp56_rac_gets_nn(c, 7);
                 s->coeff_model_dccv[pt][node] = def_prob[node];
-            } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
+            } else if (s->framep[VP56_FRAME_CURRENT]->key_frame) {
                 s->coeff_model_dccv[pt][node] = def_prob[node];
             }
 
@@ -155,7 +156,7 @@ static void vp5_parse_coeff_models(vp56_context_t *s)
                     if (vp56_rac_get_prob(c, vp5_ract_pct[ct][pt][cg][node])) {
                         def_prob[node] = vp56_rac_gets_nn(c, 7);
                         s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
-                    } else if (s->frames[VP56_FRAME_CURRENT].key_frame) {
+                    } else if (s->framep[VP56_FRAME_CURRENT]->key_frame) {
                         s->coeff_model_ract[pt][ct][cg][node] = def_prob[node];
                     }
 
@@ -163,7 +164,7 @@ static void vp5_parse_coeff_models(vp56_context_t *s)
     for (pt=0; pt<2; pt++)
         for (ctx=0; ctx<36; ctx++)
             for (node=0; node<5; node++)
-                s->coeff_model_dcct[pt][ctx][node] = clip(((s->coeff_model_dccv[pt][node] * vp5_dccv_lc[node][ctx][0] + 128) >> 8) + vp5_dccv_lc[node][ctx][1], 1, 254);
+                s->coeff_model_dcct[pt][ctx][node] = av_clip(((s->coeff_model_dccv[pt][node] * vp5_dccv_lc[node][ctx][0] + 128) >> 8) + vp5_dccv_lc[node][ctx][1], 1, 254);
 
     /* coeff_model_acct is a linear combination of coeff_model_ract */
     for (ct=0; ct<3; ct++)
@@ -171,7 +172,7 @@ static void vp5_parse_coeff_models(vp56_context_t *s)
             for (cg=0; cg<3; cg++)
                 for (ctx=0; ctx<6; ctx++)
                     for (node=0; node<5; node++)
-                        s->coeff_model_acct[pt][ct][cg][ctx][node] = clip(((s->coeff_model_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
+                        s->coeff_model_acct[pt][ct][cg][ctx][node] = av_clip(((s->coeff_model_ract[pt][ct][cg][node] * vp5_ract_lc[ct][cg][node][ctx][0] + 128) >> 8) + vp5_ract_lc[ct][cg][node][ctx][1], 1, 254);
 }
 
 static void vp5_parse_coeff(vp56_context_t *s)