[cvs] / xvidcore / src / image / postprocessing.c Repository:
ViewVC logotype

Diff of /xvidcore/src/image/postprocessing.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.6, Sat Dec 18 10:13:38 2010 UTC revision 1.7, Wed Apr 6 14:30:14 2011 UTC
# Line 132  Line 132 
132                                  const MACROBLOCK * mbs, int mb_width, int mb_height, int mb_stride,                                  const MACROBLOCK * mbs, int mb_width, int mb_height, int mb_stride,
133                                  int flags, int brightness, int frame_num, int bvop, int threads)                                  int flags, int brightness, int frame_num, int bvop, int threads)
134  {  {
135          int k, num_threads = MAX(1, MIN(threads, 4));          int k;
136          SMPDeblock data[4];  #ifndef HAVE_PTHREAD
137            int num_threads = 1;
138    #else
139            int num_threads = MAX(1, MIN(threads, 4));
140          void *status = NULL;          void *status = NULL;
141    #endif
142            SMPDeblock data[4];
143    
144          /* horizontal deblocking, dispatch threads */          /* horizontal deblocking, dispatch threads */
145          for (k = 0; k < num_threads; k++) {          for (k = 0; k < num_threads; k++) {
# Line 150  Line 155 
155    
156                  data[k].stop_y = mb_height*2;                  data[k].stop_y = mb_height*2;
157          }          }
158    #ifdef HAVE_PTHREAD
159          /* create threads */          /* create threads */
160          for (k = 1; k < num_threads; k++) {          for (k = 1; k < num_threads; k++) {
161                  pthread_create(&data[k].handle, NULL,                  pthread_create(&data[k].handle, NULL,
162                                 (void*)stripe_deblock_h, (void*)&data[k]);                                 (void*)stripe_deblock_h, (void*)&data[k]);
163          }          }
164    #endif
165          stripe_deblock_h(&data[0]);          stripe_deblock_h(&data[0]);
166    
167    #ifdef HAVE_PTHREAD
168          /* wait until all threads are finished */          /* wait until all threads are finished */
169          for (k = 1; k < num_threads; k++) {          for (k = 1; k < num_threads; k++) {
170                  pthread_join(data[k].handle, &status);                  pthread_join(data[k].handle, &status);
171          }          }
172    #endif
173    
174          /* vertical deblocking, dispatch threads */          /* vertical deblocking, dispatch threads */
175          for (k = 0; k < num_threads; k++) {          for (k = 0; k < num_threads; k++) {
# Line 172  Line 178 
178                  data[k].stop_x = mb_width*2;                  data[k].stop_x = mb_width*2;
179          }          }
180    
181    #ifdef HAVE_PTHREAD
182          /* create threads */          /* create threads */
183          for (k = 1; k < num_threads; k++) {          for (k = 1; k < num_threads; k++) {
184                  pthread_create(&data[k].handle, NULL,                  pthread_create(&data[k].handle, NULL,
185                                 (void*)stripe_deblock_v, (void*)&data[k]);                                 (void*)stripe_deblock_v, (void*)&data[k]);
186          }          }
187    #endif
188          stripe_deblock_v(&data[0]);          stripe_deblock_v(&data[0]);
189    
190    #ifdef HAVE_PTHREAD
191          /* wait until all threads are finished */          /* wait until all threads are finished */
192          for (k = 1; k < num_threads; k++) {          for (k = 1; k < num_threads; k++) {
193                  pthread_join(data[k].handle, &status);                  pthread_join(data[k].handle, &status);
194          }          }
195    #endif
196    
197          if (!bvop)          if (!bvop)
198                  tbls->prev_quant = mbs->quant;                  tbls->prev_quant = mbs->quant;

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

No admin address has been configured
ViewVC Help
Powered by ViewVC 1.0.4