[FFmpeg-cvslog] svq1: replace struct svq1_frame_size with an array.

Anton Khirnov git at videolan.org
Wed Feb 6 14:59:56 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Sat Jan 26 21:10:54 2013 +0100| [6ed9fc44badb256bdf235e700702bee46a9f6527] | committer: Anton Khirnov

svq1: replace struct svq1_frame_size with an array.

It is used as an array in svq1enc, so this is more correct.

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

 libavcodec/svq1.c    |    2 +-
 libavcodec/svq1.h    |    7 +------
 libavcodec/svq1dec.c |    4 ++--
 3 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/libavcodec/svq1.c b/libavcodec/svq1.c
index e20fa43..545df80 100644
--- a/libavcodec/svq1.c
+++ b/libavcodec/svq1.c
@@ -37,7 +37,7 @@
 #include "svq1_vlc.h"
 
 /* standard video sizes */
-const struct svq1_frame_size ff_svq1_frame_size_table[7] = {
+const uint16_t ff_svq1_frame_size_table[7][2] = {
     { 160, 120 }, { 128,  96 }, { 176, 144 }, { 352, 288 },
     { 704, 576 }, { 240, 180 }, { 320, 240 }
 };
diff --git a/libavcodec/svq1.h b/libavcodec/svq1.h
index b2055fa..70b5c37 100644
--- a/libavcodec/svq1.h
+++ b/libavcodec/svq1.h
@@ -42,11 +42,6 @@
 #define SVQ1_BLOCK_INTER_4V     2
 #define SVQ1_BLOCK_INTRA        3
 
-struct svq1_frame_size {
-    uint16_t width;
-    uint16_t height;
-};
-
 uint16_t ff_svq1_packet_checksum(const uint8_t *data,
                                  const int length, int value);
 
@@ -59,6 +54,6 @@ extern const uint8_t ff_svq1_inter_multistage_vlc[6][8][2];
 extern const uint16_t ff_svq1_intra_mean_vlc[256][2];
 extern const uint16_t ff_svq1_inter_mean_vlc[512][2];
 
-extern const struct svq1_frame_size ff_svq1_frame_size_table[7];
+extern const uint16_t ff_svq1_frame_size_table[7][2];
 
 #endif /* AVCODEC_SVQ1_H */
diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c
index 5156042..dc041dd 100644
--- a/libavcodec/svq1dec.c
+++ b/libavcodec/svq1dec.c
@@ -579,8 +579,8 @@ static int svq1_decode_frame_header(AVCodecContext *avctx, AVFrame *frame)
                 return AVERROR_INVALIDDATA;
         } else {
             /* get width, height from table */
-            s->width  = ff_svq1_frame_size_table[frame_size_code].width;
-            s->height = ff_svq1_frame_size_table[frame_size_code].height;
+            s->width  = ff_svq1_frame_size_table[frame_size_code][0];
+            s->height = ff_svq1_frame_size_table[frame_size_code][1];
         }
     }
 



More information about the ffmpeg-cvslog mailing list