Commit 1c852201 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[media] pwc: Avoid unnecessarily rebuilding the decoder tables

Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 938d5b9e
...@@ -301,6 +301,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd) ...@@ -301,6 +301,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd)
mutex_init(&pdec->lock); mutex_init(&pdec->lock);
if (pdec->last_cmd_valid && pdec->last_cmd == cmd[2])
return;
if (DEVICE_USE_CODEC3(pdev->type)) { if (DEVICE_USE_CODEC3(pdev->type)) {
flags = cmd[2] & 0x18; flags = cmd[2] & 0x18;
if (flags == 8) if (flags == 8)
...@@ -347,6 +350,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd) ...@@ -347,6 +350,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd)
for (i=0; i<MAX_OUTER_CROP_VALUE; i++) for (i=0; i<MAX_OUTER_CROP_VALUE; i++)
pwc_crop_table[MAX_OUTER_CROP_VALUE+256+i] = 255; pwc_crop_table[MAX_OUTER_CROP_VALUE+256+i] = 255;
#endif #endif
pdec->last_cmd = cmd[2];
pdec->last_cmd_valid = 1;
} }
/* /*
......
...@@ -31,11 +31,14 @@ struct pwc_dec23_private ...@@ -31,11 +31,14 @@ struct pwc_dec23_private
{ {
struct mutex lock; struct mutex lock;
unsigned char last_cmd, last_cmd_valid;
unsigned int scalebits; unsigned int scalebits;
unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */ unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */
unsigned int reservoir; unsigned int reservoir;
unsigned int nbits_in_reservoir; unsigned int nbits_in_reservoir;
const unsigned char *stream; const unsigned char *stream;
int temp_colors[16]; int temp_colors[16];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment