[FFmpeg-cvslog] lavc/ccaption_dec: use ff_parity()

Clément Bœsch git at videolan.org
Thu Jan 7 22:52:19 CET 2016


ffmpeg | branch: master | Clément Bœsch <u at pkh.me> | Sun Jan  3 18:31:54 2016 +0100| [00e96613f3e09bff21126814dbfc0dccdfc4159f] | committer: Clément Bœsch

lavc/ccaption_dec: use ff_parity()

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

 libavcodec/ccaption_dec.c |   38 ++------------------------------------
 1 file changed, 2 insertions(+), 36 deletions(-)

diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c
index 8ee2c65..bdfe35f 100644
--- a/libavcodec/ccaption_dec.c
+++ b/libavcodec/ccaption_dec.c
@@ -100,40 +100,6 @@ static const unsigned char pac2_attribs[32][3] = // Color, font, ident
     /* total 32 entries */
 };
 
-/* 0-255 needs 256 spaces */
-static const uint8_t parity_table[256] = { 0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           0, 1, 1, 0, 1, 0, 0, 1,
-                                           1, 0, 0, 1, 0, 1, 1, 0 };
-
 struct Screen {
     /* +1 is used to compensate null character of string */
     uint8_t characters[SCREEN_ROWS][SCREEN_COLUMNS+1];
@@ -236,10 +202,10 @@ static int validate_cc_data_pair(uint8_t *cc_data_pair)
 
     // if EIA-608 data then verify parity.
     if (cc_type==0 || cc_type==1) {
-        if (!parity_table[cc_data_pair[2]]) {
+        if (!ff_parity(cc_data_pair[2])) {
             return AVERROR_INVALIDDATA;
         }
-        if (!parity_table[cc_data_pair[1]]) {
+        if (!ff_parity(cc_data_pair[1])) {
             cc_data_pair[1]=0x7F;
         }
     }



More information about the ffmpeg-cvslog mailing list