ducatividenc: cleanup param initialization
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Wed, 22 Aug 2012 14:26:51 +0000 (14:26 +0000)
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Fri, 7 Sep 2012 13:57:47 +0000 (13:57 +0000)
Use a local params pointer, and remove a nop assignment
and a duplicate one.

src/gstducatividenc.c

index 2c4371940a7be23ac4e3ba29cdc114a53a80fffe..2d70f368a6d32b85713807cd2782d473b9216d40 100644 (file)
@@ -315,6 +315,7 @@ static gboolean
 gst_ducati_videnc_configure_default (GstDucatiVidEnc * self)
 {
   VIDENC2_DynamicParams *dynParams;
+  VIDENC2_Params *params;
   const GstVideoState *state;
   int i;
 
@@ -326,27 +327,26 @@ gst_ducati_videnc_configure_default (GstDucatiVidEnc * self)
   if (self->rect.h == 0)
     self->rect.h = state->height;
 
-  self->params = (VIDENC2_Params *) self->params;
-  self->params->encodingPreset = 0x03;
-  self->params->rateControlPreset = self->rate_preset;
-  self->params->maxHeight = self->rect.h;
-  self->params->maxWidth = self->rect.w;
-  self->params->dataEndianness = XDM_BYTE;
-  self->params->maxInterFrameInterval = 1;
-  self->params->maxBitRate = -1;
-  self->params->minBitRate = 0;
-  self->params->inputChromaFormat = XDM_YUV_420SP;
-  self->params->inputContentType = IVIDEO_PROGRESSIVE;
-  self->params->operatingMode = IVIDEO_ENCODE_ONLY;
-  self->params->inputDataMode = IVIDEO_ENTIREFRAME;
-  self->params->outputDataMode = IVIDEO_ENTIREFRAME;
-  self->params->numInputDataUnits = 1;
-  self->params->numOutputDataUnits = 1;
+  params = (VIDENC2_Params *) self->params;
+  params->encodingPreset = 0x03;
+  params->rateControlPreset = self->rate_preset;
+  params->maxHeight = self->rect.h;
+  params->maxWidth = self->rect.w;
+  params->dataEndianness = XDM_BYTE;
+  params->maxInterFrameInterval = 1;
+  params->maxBitRate = -1;
+  params->minBitRate = 0;
+  params->inputChromaFormat = XDM_YUV_420SP;
+  params->inputContentType = IVIDEO_PROGRESSIVE;
+  params->operatingMode = IVIDEO_ENCODE_ONLY;
+  params->inputDataMode = IVIDEO_ENTIREFRAME;
+  params->outputDataMode = IVIDEO_ENTIREFRAME;
+  params->numInputDataUnits = 1;
+  params->numOutputDataUnits = 1;
   for (i = 0; i < IVIDEO_MAX_NUM_METADATA_PLANES; i++) {
-    self->params->metadataType[i] = IVIDEO_METADATAPLANE_NONE;
+    params->metadataType[i] = IVIDEO_METADATAPLANE_NONE;
   }
 
-  dynParams = self->dynParams;
   dynParams = (VIDENC2_DynamicParams *) self->dynParams;
 
   dynParams->refFrameRate =