ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VLIB / P263 / p263_gob_layer.c
1 #include <VLIB/video_packetizer.h>
2
3 #include "p263_codec.h"
4 #include "p263_layers.h"
5 #include "p263_huffman.h"
6
7 C_RESULT p263_read_gob_layer( video_controller_t* controller, video_stream_t* stream )
8 {
9   p263_codec_t* p263_codec = (p263_codec_t*) controller->video_codec;
10   p263_picture_layer_t* picture_layer = &p263_codec->picture_layer;
11   p263_gob_layer_t* gob = &picture_layer->gobs[controller->blockline];
12   uint32_t gn = 0, gfid = 0, gsbi = 0;
13
14   // Read Group Number (GN) (5 bits)
15   video_read_data( stream, &gn, 5 );
16
17   // Read GOB Sub-Bitstream Indicator (GSBI) (2 bits)
18   video_read_data( stream, &gsbi, 2 );
19
20   // Read GOB Frame ID (GFID) (2 bits)
21   video_read_data( stream, &gfid, 2 );
22
23   // Read Quantizer Information (GQUANT) (5 bits)
24   video_read_data( stream, &gob->gquant, 5 );
25   controller->Qp = gob->gquant;
26
27   return C_OK;
28 }
29