]> git.sesse.net Git - vlc/blob - src/spu_decoder/spu_decoder.c
* Closing Debian bug #119369 which was fixed a while ago.
[vlc] / src / spu_decoder / spu_decoder.c
1 /*****************************************************************************
2  * spu_decoder.c : spu decoder thread
3  *****************************************************************************
4  * Copyright (C) 2000 VideoLAN
5  * $Id: spu_decoder.c,v 1.49 2001/09/26 12:32:25 massiot Exp $
6  *
7  * Authors: Samuel Hocevar <sam@zoy.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  * 
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "defs.h"
28
29 #ifdef HAVE_UNISTD_H
30 #include <unistd.h>                                              /* getpid() */
31 #endif
32
33 #ifdef WIN32                   /* getpid() for win32 is located in process.h */
34 #include <process.h>
35 #endif
36
37 #include <stdlib.h>                                      /* malloc(), free() */
38 #include <string.h>                                    /* memcpy(), memset() */
39
40 #include "config.h"
41 #include "common.h"
42 #include "threads.h"
43 #include "mtime.h"
44
45 #include "intf_msg.h"
46
47 #include "stream_control.h"
48 #include "input_ext-dec.h"
49
50 #include "video.h"
51 #include "video_output.h"
52
53 #include "spu_decoder.h"
54
55 /*****************************************************************************
56  * Local prototypes
57  *****************************************************************************/
58 static int  InitThread  ( spudec_thread_t * );
59 static void RunThread   ( spudec_thread_t * );
60 static void ErrorThread ( spudec_thread_t * );
61 static void EndThread   ( spudec_thread_t * );
62
63 static int  SyncPacket           ( spudec_thread_t * );
64 static void ParsePacket          ( spudec_thread_t * );
65 static int  ParseControlSequences( spudec_thread_t *, subpicture_t * );
66 static int  ParseRLE             ( spudec_thread_t *, subpicture_t *, u8 * );
67
68 /*****************************************************************************
69  * spudec_CreateThread: create a spu decoder thread
70  *****************************************************************************/
71 vlc_thread_t spudec_CreateThread( vdec_config_t * p_config )
72 {
73     spudec_thread_t *     p_spudec;
74
75     /* Allocate the memory needed to store the thread's structure */
76     p_spudec = (spudec_thread_t *)malloc( sizeof(spudec_thread_t) );
77
78     if ( p_spudec == NULL )
79     {
80         intf_ErrMsg( "spudec error: not enough memory "
81                      "for spudec_CreateThread() to create the new thread" );
82         return( 0 );
83     }
84
85     /*
86      * Initialize the thread properties
87      */
88     p_spudec->p_config = p_config;
89
90     p_spudec->p_fifo = p_config->decoder_config.p_decoder_fifo;
91
92     /* Spawn a video output if there is none */
93     vlc_mutex_lock( &p_vout_bank->lock );
94
95     if( p_vout_bank->i_count == 0 )
96     {
97         intf_WarnMsg( 1, "spudec: no vout present, spawning one" );
98
99         p_spudec->p_vout = vout_CreateThread( NULL, 0, 0 );
100
101         /* Everything failed */
102         if( p_spudec->p_vout == NULL )
103         {
104             intf_Msg( "spudec: can't open vout, aborting" );
105             vlc_mutex_unlock( &p_vout_bank->lock );
106             free( p_spudec );
107
108             return 0;
109         }
110
111         p_vout_bank->pp_vout[ p_vout_bank->i_count ] = p_spudec->p_vout;
112         p_vout_bank->i_count++;
113     }
114     else
115     {
116         /* Take the first video output FIXME: take the best one */
117         p_spudec->p_vout = p_vout_bank->pp_vout[ 0 ];
118     }
119
120     vlc_mutex_unlock( &p_vout_bank->lock );
121
122     /* Spawn the spu decoder thread */
123     if ( vlc_thread_create(&p_spudec->thread_id, "spu decoder",
124          (vlc_thread_func_t)RunThread, (void *)p_spudec) )
125     {
126         intf_ErrMsg( "spudec error: can't spawn spu decoder thread" );
127         free( p_spudec );
128         return 0;
129     }
130
131     return( p_spudec->thread_id );
132 }
133
134 /* following functions are local */
135
136 /*****************************************************************************
137  * InitThread: initialize spu decoder thread
138  *****************************************************************************
139  * This function is called from RunThread and performs the second step of the
140  * initialization. It returns 0 on success. Note that the thread's flag are not
141  * modified inside this function.
142  *****************************************************************************/
143 static int InitThread( spudec_thread_t *p_spudec )
144 {
145     p_spudec->p_config->decoder_config.pf_init_bit_stream(
146             &p_spudec->bit_stream,
147             p_spudec->p_config->decoder_config.p_decoder_fifo, NULL, NULL );
148
149     /* Mark thread as running and return */
150     return( 0 );
151 }
152
153 /*****************************************************************************
154  * RunThread: spu decoder thread
155  *****************************************************************************
156  * spu decoder thread. This function only returns when the thread is
157  * terminated.
158  *****************************************************************************/
159 static void RunThread( spudec_thread_t *p_spudec )
160 {
161     intf_WarnMsg( 3, "spudec: spu decoder thread %i spawned", getpid() );
162
163     /*
164      * Initialize thread and free configuration
165      */
166     p_spudec->p_fifo->b_error = InitThread( p_spudec );
167
168     /*
169      * Main loop - it is not executed if an error occured during
170      * initialization
171      */
172     while( (!p_spudec->p_fifo->b_die) && (!p_spudec->p_fifo->b_error) )
173     {
174         if( !SyncPacket( p_spudec ) )
175         {
176             ParsePacket( p_spudec );
177         }
178     }
179
180     /*
181      * Error loop
182      */
183     if( p_spudec->p_fifo->b_error )
184     {
185         ErrorThread( p_spudec );
186     }
187
188     /* End of thread */
189     intf_WarnMsg( 3, "spudec: destroying spu decoder thread %i", getpid() );
190     EndThread( p_spudec );
191 }
192
193 /*****************************************************************************
194  * ErrorThread: RunThread() error loop
195  *****************************************************************************
196  * This function is called when an error occured during thread main's loop. The
197  * thread can still receive feed, but must be ready to terminate as soon as
198  * possible.
199  *****************************************************************************/
200 static void ErrorThread( spudec_thread_t *p_spudec )
201 {
202     /* We take the lock, because we are going to read/write the start/end
203      * indexes of the decoder fifo */
204     vlc_mutex_lock( &p_spudec->p_fifo->data_lock );
205
206     /* Wait until a `die' order is sent */
207     while( !p_spudec->p_fifo->b_die )
208     {
209         /* Trash all received PES packets */
210         while( !DECODER_FIFO_ISEMPTY(*p_spudec->p_fifo) )
211         {
212             p_spudec->p_fifo->pf_delete_pes( p_spudec->p_fifo->p_packets_mgt,
213                     DECODER_FIFO_START(*p_spudec->p_fifo) );
214             DECODER_FIFO_INCSTART( *p_spudec->p_fifo );
215         }
216
217         /* Waiting for the input thread to put new PES packets in the fifo */
218         vlc_cond_wait( &p_spudec->p_fifo->data_wait,
219                        &p_spudec->p_fifo->data_lock );
220     }
221
222     /* We can release the lock before leaving */
223     vlc_mutex_unlock( &p_spudec->p_fifo->data_lock );
224 }
225
226 /*****************************************************************************
227  * EndThread: thread destruction
228  *****************************************************************************
229  * This function is called when the thread ends after a sucessful
230  * initialization.
231  *****************************************************************************/
232 static void EndThread( spudec_thread_t *p_spudec )
233 {
234     free( p_spudec->p_config );
235     free( p_spudec );
236 }
237
238 /*****************************************************************************
239  * SyncPacket: get in sync with the stream
240  *****************************************************************************
241  * This function makes a few sanity checks and returns 0 if it looks like we
242  * are at the beginning of a subpicture packet.
243  *****************************************************************************/
244 static int SyncPacket( spudec_thread_t *p_spudec )
245 {
246     /* Re-align the buffer on an 8-bit boundary */
247     RealignBits( &p_spudec->bit_stream );
248
249     /* The total SPU packet size, often bigger than a PS packet */
250     p_spudec->i_spu_size = GetBits( &p_spudec->bit_stream, 16 );
251
252     /* The RLE stuff size (remove 4 because we just read 32 bits) */
253     p_spudec->i_rle_size = ShowBits( &p_spudec->bit_stream, 16 ) - 4;
254
255     /* If the values we got are a bit strange, skip packet */
256     if( !p_spudec->i_spu_size
257          || ( p_spudec->i_rle_size >= p_spudec->i_spu_size ) )
258     {
259         return( 1 );
260     }
261
262     RemoveBits( &p_spudec->bit_stream, 16 );
263
264     return( 0 );
265 }
266
267 /*****************************************************************************
268  * ParsePacket: parse an SPU packet and send it to the video output
269  *****************************************************************************
270  * This function parses the SPU packet and, if valid, sends it to the
271  * video output.
272  *****************************************************************************/
273 static void ParsePacket( spudec_thread_t *p_spudec )
274 {
275     subpicture_t * p_spu;
276     u8           * p_src;
277     unsigned int   i_offset;
278
279     intf_WarnMsg( 3, "spudec: trying to gather a 0x%.2x long subtitle",
280                   p_spudec->i_spu_size );
281
282     /* We cannot display a subpicture with no date */
283     if( DECODER_FIFO_START(*p_spudec->p_fifo)->i_pts == 0 )
284     {
285         intf_WarnMsg( 3, "spudec error: subtitle without a date" );
286         return;
287     }
288
289     /* Allocate the subpicture internal data. */
290     p_spu = vout_CreateSubPicture( p_spudec->p_vout, DVD_SUBPICTURE,
291                                    p_spudec->i_rle_size * 4 );
292     /* Rationale for the "p_spudec->i_rle_size * 4": we are going to
293      * expand the RLE stuff so that we won't need to read nibbles later
294      * on. This will speed things up a lot. Plus, we'll only need to do
295      * this stupid interlacing stuff once. */
296
297     if( p_spu == NULL )
298     {
299         return;
300     }
301
302     /* Get display time now. If we do it later, we may miss the PTS. */
303     p_spudec->i_pts = DECODER_FIFO_START(*p_spudec->p_fifo)->i_pts;
304
305     /* Allocate the temporary buffer we will parse */
306     p_src = malloc( p_spudec->i_rle_size );
307
308     if( p_src == NULL )
309     {
310         intf_ErrMsg( "spudec error: could not allocate p_src" );
311         vout_DestroySubPicture( p_spudec->p_vout, p_spu );
312         return;
313     }
314
315     /* Get RLE data */
316     for( i_offset = 0;
317          i_offset + SPU_CHUNK_SIZE < p_spudec->i_rle_size;
318          i_offset += SPU_CHUNK_SIZE )
319     {
320         GetChunk( &p_spudec->bit_stream, p_src + i_offset, SPU_CHUNK_SIZE );
321
322         /* Abort subtitle parsing if we were requested to stop */
323         if( p_spudec->p_fifo->b_die )
324         {
325             free( p_src );
326             vout_DestroySubPicture( p_spudec->p_vout, p_spu );
327             return;
328         }
329     }
330
331     GetChunk( &p_spudec->bit_stream, p_src + i_offset,
332               p_spudec->i_rle_size - i_offset );
333
334 #if 0
335     /* Dump the subtitle info */
336     intf_WarnHexDump( 5, p_spu->p_data, p_spudec->i_rle_size );
337 #endif
338
339     /* Getting the control part */
340     if( ParseControlSequences( p_spudec, p_spu ) )
341     {
342         /* There was a parse error, delete the subpicture */
343         free( p_src );
344         vout_DestroySubPicture( p_spudec->p_vout, p_spu );
345         return;
346     }
347
348     /* At this point, no more GetBit() command is needed, so we have all
349      * the data we need to tell whether the subtitle is valid. Thus we
350      * try to display it and we ignore b_die. */
351
352     if( ParseRLE( p_spudec, p_spu, p_src ) )
353     {
354         /* There was a parse error, delete the subpicture */
355         free( p_src );
356         vout_DestroySubPicture( p_spudec->p_vout, p_spu );
357         return;
358     }
359
360     intf_WarnMsg( 3, "spudec: total size: 0x%x, RLE offsets: 0x%x 0x%x",
361                   p_spudec->i_spu_size,
362                   p_spu->type.spu.i_offset[0], p_spu->type.spu.i_offset[1] );
363
364     /* SPU is finished - we can ask the video output to display it */
365     vout_DisplaySubPicture( p_spudec->p_vout, p_spu );
366
367     /* Clean up */
368     free( p_src );
369 }
370
371 /*****************************************************************************
372  * ParseControlSequences: parse all SPU control sequences
373  *****************************************************************************
374  * This is the most important part in SPU decoding. We get dates, palette
375  * information, coordinates, and so on. For more information on the
376  * subtitles format, see http://sam.zoy.org/doc/dvd/subtitles/index.html
377  *****************************************************************************/
378 static int ParseControlSequences( spudec_thread_t *p_spudec,
379                                   subpicture_t * p_spu )
380 {
381     /* Our current index in the SPU packet */
382     int i_index = p_spudec->i_rle_size + 4;
383
384     /* The next start-of-control-sequence index and the previous one */
385     int i_next_seq, i_cur_seq;
386
387     /* Command time and date */
388     u8  i_command;
389     int i_date;
390
391     /* XXX: temporary variables */
392     boolean_t b_force_display = 0;
393
394     /* Initialize the structure */
395     p_spu->i_start = p_spu->i_stop = 0;
396     p_spu->b_ephemer = 0;
397
398     do
399     {
400         /* Get the control sequence date */
401         i_date = GetBits( &p_spudec->bit_stream, 16 );
402  
403         /* Next offset */
404         i_cur_seq = i_index;
405         i_next_seq = GetBits( &p_spudec->bit_stream, 16 );
406  
407         /* Skip what we just read */
408         i_index += 4;
409  
410         do
411         {
412             i_command = GetBits( &p_spudec->bit_stream, 8 );
413             i_index++;
414  
415             switch( i_command )
416             {
417                 case SPU_CMD_FORCE_DISPLAY:
418
419                     /* 00 (force displaying) */
420                     p_spu->i_start = p_spudec->i_pts + ( i_date * 11000 );
421                     b_force_display = 1;
422  
423                     break;
424  
425                 /* Convert the dates in seconds to PTS values */
426                 case SPU_CMD_START_DISPLAY:
427  
428                     /* 01 (start displaying) */
429                     p_spu->i_start = p_spudec->i_pts + ( i_date * 11000 );
430  
431                     break;
432  
433                 case SPU_CMD_STOP_DISPLAY:
434  
435                     /* 02 (stop displaying) */
436                     p_spu->i_stop = p_spudec->i_pts + ( i_date * 11000 );
437  
438                     break;
439  
440                 case SPU_CMD_SET_PALETTE:
441  
442                     /* 03xxxx (palette) - trashed */
443                     RemoveBits( &p_spudec->bit_stream, 16 );
444                     i_index += 2;
445  
446                     break;
447  
448                 case SPU_CMD_SET_ALPHACHANNEL:
449  
450                     /* 04xxxx (alpha channel) - trashed */
451                     RemoveBits( &p_spudec->bit_stream, 16 );
452                     i_index += 2;
453  
454                     break;
455  
456                 case SPU_CMD_SET_COORDINATES:
457  
458                     /* 05xxxyyyxxxyyy (coordinates) */
459                     p_spu->i_x = GetBits( &p_spudec->bit_stream, 12 );
460                     p_spu->i_width = GetBits( &p_spudec->bit_stream, 12 )
461                                       - p_spu->i_x + 1;
462  
463                     p_spu->i_y = GetBits( &p_spudec->bit_stream, 12 );
464                     p_spu->i_height = GetBits( &p_spudec->bit_stream, 12 )
465                                        - p_spu->i_y + 1;
466  
467                     i_index += 6;
468  
469                     break;
470  
471                 case SPU_CMD_SET_OFFSETS:
472  
473                     /* 06xxxxyyyy (byte offsets) */
474                     p_spu->type.spu.i_offset[0] =
475                         GetBits( &p_spudec->bit_stream, 16 ) - 4;
476  
477                     p_spu->type.spu.i_offset[1] =
478                         GetBits( &p_spudec->bit_stream, 16 ) - 4;
479  
480                     i_index += 4;
481  
482                     break;
483  
484                 case SPU_CMD_END:
485  
486                     /* ff (end) */
487                     break;
488  
489                 default:
490  
491                     /* xx (unknown command) */
492                     intf_ErrMsg( "spudec error: unknown command 0x%.2x",
493                                  i_command );
494                     return( 1 );
495             }
496
497             /* We need to check for quit commands here */
498             if( p_spudec->p_fifo->b_die )
499             {
500                 return( 1 );
501             }
502
503         } while( i_command != SPU_CMD_END );
504
505     } while( i_index == i_next_seq );
506
507     /* Check that the next sequence index matches the current one */
508     if( i_next_seq != i_cur_seq )
509     {
510         intf_ErrMsg( "spudec error: index mismatch (0x%.4x != 0x%.4x)",
511                      i_next_seq, i_cur_seq );
512         return( 1 );
513     }
514
515     if( i_index > p_spudec->i_spu_size )
516     {
517         intf_ErrMsg( "spudec error: uh-oh, we went too far (0x%.4x > 0x%.4x)",
518                      i_index, p_spudec->i_spu_size );
519         return( 1 );
520     }
521
522     if( !p_spu->i_start )
523     {
524         intf_ErrMsg( "spudec error: no `start display' command" );
525     }
526
527     if( !p_spu->i_stop )
528     {
529         /* This subtitle will live for 5 seconds or until the next subtitle */
530         p_spu->i_stop = p_spu->i_start + 500 * 11000;
531         p_spu->b_ephemer = 1;
532     }
533
534     /* Get rid of padding bytes */
535     switch( p_spudec->i_spu_size - i_index )
536     {
537         /* Zero or one padding byte, quite usual */
538         case 1:
539             RemoveBits( &p_spudec->bit_stream, 8 );
540             i_index++;
541         case 0:
542             break;
543
544         /* More than one padding byte - this is very strange, but
545          * we can deal with it */
546         default:
547             intf_WarnMsg( 2, "spudec warning: %i padding bytes, we usually "
548                              "get 0 or 1 of them",
549                           p_spudec->i_spu_size - i_index );
550
551             while( i_index < p_spudec->i_spu_size )
552             {
553                 RemoveBits( &p_spudec->bit_stream, 8 );
554                 i_index++;
555             }
556
557             break;
558     }
559
560     if( b_force_display )
561     {
562         intf_ErrMsg( "spudec: \"force display\" command" );
563         intf_ErrMsg( "spudec: send mail to <sam@zoy.org> if you "
564                      "want to help debugging this" );
565     }
566
567     /* Successfully parsed ! */
568     return( 0 );
569 }
570
571 /*****************************************************************************
572  * ParseRLE: parse the RLE part of the subtitle
573  *****************************************************************************
574  * This part parses the subtitle graphical data and stores it in a more
575  * convenient structure for later decoding. For more information on the
576  * subtitles format, see http://sam.zoy.org/doc/dvd/subtitles/index.html
577  *****************************************************************************/
578 static int ParseRLE( spudec_thread_t *p_spudec,
579                      subpicture_t * p_spu, u8 * p_src )
580 {
581     unsigned int i_code;
582
583     unsigned int i_width = p_spu->i_width;
584     unsigned int i_height = p_spu->i_height;
585     unsigned int i_x, i_y;
586
587     u16 *p_dest = (u16 *)p_spu->p_data;
588
589     /* The subtitles are interlaced, we need two offsets */
590     unsigned int  i_id = 0;                   /* Start on the even SPU layer */
591     unsigned int  pi_table[ 2 ];
592     unsigned int *pi_offset;
593
594     boolean_t b_empty_top = 1,
595               b_empty_bottom = 0;
596     unsigned int i_skipped_top = 0,
597                  i_skipped_bottom = 0;
598
599     pi_table[ 0 ] = p_spu->type.spu.i_offset[ 0 ] << 1;
600     pi_table[ 1 ] = p_spu->type.spu.i_offset[ 1 ] << 1;
601
602     for( i_y = 0 ; i_y < i_height ; i_y++ )
603     {
604         pi_offset = pi_table + i_id;
605
606         for( i_x = 0 ; i_x < i_width ; i_x += i_code >> 2 )
607         {
608             i_code = AddNibble( 0, p_src, pi_offset );
609
610             if( i_code < 0x04 )
611             {
612                 i_code = AddNibble( i_code, p_src, pi_offset );
613
614                 if( i_code < 0x10 )
615                 {
616                     i_code = AddNibble( i_code, p_src, pi_offset );
617
618                     if( i_code < 0x040 )
619                     {
620                         i_code = AddNibble( i_code, p_src, pi_offset );
621
622                         if( i_code < 0x0100 )
623                         {
624                             /* If the 14 first bits are set to 0, then it's a
625                              * new line. We emulate it. */
626                             if( i_code < 0x0004 )
627                             {
628                                 i_code |= ( i_width - i_x ) << 2;
629                             }
630                             else
631                             {
632                                 /* We have a boo boo ! */
633                                 intf_ErrMsg( "spudec error: unknown RLE code "
634                                              "0x%.4x", i_code );
635                                 return( 1 );
636                             }
637                         }
638                     }
639                 }
640             }
641
642             if( ( (i_code >> 2) + i_x + i_y * i_width ) > i_height * i_width )
643             {
644                 intf_ErrMsg( "spudec error: out of bounds, %i at (%i,%i) is "
645                              "out of %ix%i",
646                              i_code >> 2, i_x, i_y, i_width, i_height );
647                 return( 1 );
648             }
649
650             if( i_code == (i_width << 2) ) /* FIXME: we assume 0 is transp */
651             {
652                 if( b_empty_top )
653                 {
654                     /* This is a blank top line, we skip it */
655                     i_skipped_top++;
656                 }
657                 else
658                 {
659                     /* We can't be sure the current lines will be skipped,
660                      * so we store the code just in case. */
661                     *p_dest++ = i_code;
662
663                     b_empty_bottom = 1;
664                     i_skipped_bottom++;
665                 }
666             }
667             else
668             {
669                 /* We got a valid code, store it */
670                 *p_dest++ = i_code;
671
672                 /* Valid code means no blank line */
673                 b_empty_top = 0;
674                 b_empty_bottom = 0;
675                 i_skipped_bottom = 0;
676             }
677         }
678
679         /* Check that we didn't go too far */
680         if( i_x > i_width )
681         {
682             intf_ErrMsg( "spudec error: i_x overflowed, %i > %i",
683                          i_x, i_width );
684             return( 1 );
685         }
686
687         /* Byte-align the stream */
688         if( *pi_offset & 0x1 )
689         {
690             (*pi_offset)++;
691         }
692
693         /* Swap fields */
694         i_id = ~i_id & 0x1;
695     }
696
697     /* We shouldn't get any padding bytes */
698     if( i_y < i_height )
699     {
700         intf_ErrMsg( "spudec: padding bytes found in RLE sequence" );
701         intf_ErrMsg( "spudec: send mail to <sam@zoy.org> if you "
702                      "want to help debugging this" );
703
704         /* Skip them just in case */
705         while( i_y < i_height )
706         {
707             *p_dest++ = i_width << 2;
708             i_y++;
709         }
710
711         return( 1 );
712     }
713
714     intf_WarnMsg( 3, "spudec: valid subtitle, size: %ix%i, position: %i,%i",
715                   p_spu->i_width, p_spu->i_height, p_spu->i_x, p_spu->i_y );
716
717     /* Crop if necessary */
718     if( i_skipped_top || i_skipped_bottom )
719     {
720         p_spu->i_y += i_skipped_top;
721         p_spu->i_height -= i_skipped_top + i_skipped_bottom;
722
723         intf_WarnMsg( 3, "spudec: cropped to: %ix%i, position: %i,%i",
724                       p_spu->i_width, p_spu->i_height, p_spu->i_x, p_spu->i_y );
725     }
726
727     return( 0 );
728 }
729