radeon/uvd: add Define Restart Interval to MJPEG bitstream reconstruction
authorLeo Liu <leo.liu@amd.com>
Fri, 25 Aug 2017 17:17:41 +0000 (13:17 -0400)
committerLeo Liu <leo.liu@amd.com>
Sun, 3 Sep 2017 01:33:11 +0000 (21:33 -0400)
It adds the capacity to decode MJPEG stream with DRI marker

Signed-off-by: Leo Liu <leo.liu@amd.com>
src/gallium/drivers/radeon/radeon_uvd.c

index 228f654af1b7538ed577335e0565be24c31ace1c..00d6267018236834fc87e09b6398d5d1a83ec527 100644 (file)
@@ -1012,6 +1012,17 @@ static void get_mjpeg_slice_header(struct ruvd_decoder *dec, struct pipe_mjpeg_p
 
        saved_size = size;
 
+       /* DRI */
+       if (pic->slice_parameter.restart_interval) {
+               buf[size++] = 0xff;
+               buf[size++] = 0xdd;
+               buf[size++] = 0x00;
+               buf[size++] = 0x04;
+               bs = (uint16_t*)&buf[size++];
+               *bs = util_bswap16(pic->slice_parameter.restart_interval);
+               saved_size = ++size;
+       }
+
        /* SOF */
        buf[size++] = 0xff;
        buf[size++] = 0xc0;