aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/pwc
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-01-10 11:23:34 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-01-16 08:09:20 -0500
commit1c852201a28601b1379857f615e99071211294c6 (patch)
treeb3a2b67c3d67bd9c9552af026a505062ce1cb78c /drivers/media/video/pwc
parent938d5b9e7c2e20a7e609ad5874c6e7d8d391e6e9 (diff)
[media] pwc: Avoid unnecessarily rebuilding the decoder tables
Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pwc')
-rw-r--r--drivers/media/video/pwc/pwc-dec23.c6
-rw-r--r--drivers/media/video/pwc/pwc-dec23.h3
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/video/pwc/pwc-dec23.c b/drivers/media/video/pwc/pwc-dec23.c
index 6d48c1f90683..98772efc5bde 100644
--- a/drivers/media/video/pwc/pwc-dec23.c
+++ b/drivers/media/video/pwc/pwc-dec23.c
@@ -301,6 +301,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd)
301 301
302 mutex_init(&pdec->lock); 302 mutex_init(&pdec->lock);
303 303
304 if (pdec->last_cmd_valid && pdec->last_cmd == cmd[2])
305 return;
306
304 if (DEVICE_USE_CODEC3(pdev->type)) { 307 if (DEVICE_USE_CODEC3(pdev->type)) {
305 flags = cmd[2] & 0x18; 308 flags = cmd[2] & 0x18;
306 if (flags == 8) 309 if (flags == 8)
@@ -347,6 +350,9 @@ void pwc_dec23_init(struct pwc_device *pdev, unsigned char *cmd)
347 for (i=0; i<MAX_OUTER_CROP_VALUE; i++) 350 for (i=0; i<MAX_OUTER_CROP_VALUE; i++)
348 pwc_crop_table[MAX_OUTER_CROP_VALUE+256+i] = 255; 351 pwc_crop_table[MAX_OUTER_CROP_VALUE+256+i] = 255;
349#endif 352#endif
353
354 pdec->last_cmd = cmd[2];
355 pdec->last_cmd_valid = 1;
350} 356}
351 357
352/* 358/*
diff --git a/drivers/media/video/pwc/pwc-dec23.h b/drivers/media/video/pwc/pwc-dec23.h
index a29068ee428b..af31d6047bb2 100644
--- a/drivers/media/video/pwc/pwc-dec23.h
+++ b/drivers/media/video/pwc/pwc-dec23.h
@@ -31,11 +31,14 @@ struct pwc_dec23_private
31{ 31{
32 struct mutex lock; 32 struct mutex lock;
33 33
34 unsigned char last_cmd, last_cmd_valid;
35
34 unsigned int scalebits; 36 unsigned int scalebits;
35 unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */ 37 unsigned int nbitsmask, nbits; /* Number of bits of a color in the compressed stream */
36 38
37 unsigned int reservoir; 39 unsigned int reservoir;
38 unsigned int nbits_in_reservoir; 40 unsigned int nbits_in_reservoir;
41
39 const unsigned char *stream; 42 const unsigned char *stream;
40 int temp_colors[16]; 43 int temp_colors[16];
41 44