[FFmpeg-soc] [soc]: r3824 - dirac/libavcodec/dirac.c

conrad subversion at mplayerhq.hu
Tue Nov 11 09:38:31 CET 2008


Author: conrad
Date: Tue Nov 11 09:38:31 2008
New Revision: 3824

Log:
Simplify


Modified:
   dirac/libavcodec/dirac.c

Modified: dirac/libavcodec/dirac.c
==============================================================================
--- dirac/libavcodec/dirac.c	(original)
+++ dirac/libavcodec/dirac.c	Tue Nov 11 09:38:31 2008
@@ -284,33 +284,23 @@ static int parse_source_parameters(GetBi
         if (!source->color_spec_index) {
             /* color primaries */
             if (get_bits1(gb)) {
-                unsigned int primaries_idx = svq3_get_ue_golomb(gb);
-
-                if (primaries_idx > 3)
-                    return -1;
-
-                source->color_spec.primaries = primaries_idx;
+                source->color_spec.primaries = svq3_get_ue_golomb(gb);
             }
 
             /* override matrix */
             if (get_bits1(gb)) {
-                unsigned int matrix_idx = svq3_get_ue_golomb(gb);
-
-                if (matrix_idx > 2)
-                    return -1;
-
-                source->color_spec.matrix = matrix_idx;
+                source->color_spec.matrix = svq3_get_ue_golomb(gb);
             }
 
             /* transfer function */
             if (get_bits1(gb)) {
-                unsigned int tf_idx = svq3_get_ue_golomb(gb);
-
-                if (tf_idx > 3)
-                    return -1;
-
-                source->color_spec.transfer_function = tf_idx;
+                source->color_spec.transfer_function = svq3_get_ue_golomb(gb);
             }
+
+            if (source->color_spec.primaries > 3 ||
+                source->color_spec.matrix > 2 ||
+                source->color_spec.transfer_function > 3)
+                return -1;
         }
     }
     source->k_r = dirac_preset_kr[source->color_spec_index];



More information about the FFmpeg-soc mailing list