1、STDmBSI BS ISO/IEC 13522-3-ENGL 1777 W Lb24bb7 Ob403b3 Ti4 BRITISH STANDARD Information technology - Coding of multimedia and hypermedia information Part 3. MHEG script interchange representation ICs 36.040 BS ISO/EC 13522-3 : 1997 U- NO COPYING WITHOUT BSI PERMISSION EXCEPT AS PERMITTED BY COPYRIGH
2、T LAW BS ISO/IEC 136223 : 1997 National foreword This British Standard reproduces verbatim ISOAEC 135223 : 1997 and implements it as the UK national standard. The K participation in its preparation was entsusted to Technicai Committee ISTL37, Coding of picture, audio, multimedia and hypemedia inform
3、ation, wbkb has the responsibility to: - aid enquirers to understand the tea - present to the responsible inteniationaYEuropean conunitte? any enqujries on the interpretaion, or proposals for change, and keep the UK inkrests informed; - monitor related international and European developments and pro
4、mulgate them in the UK. A list of organizations represented on this commitke can be obtained on request Cross-references The British Standards which implement international or European pubiications referred to in this document may be found in the BSI Standards Catalogue under the section entitled In
5、ternational Standards Correspondence Index, or using the Find facility of the BSI Standards Electronic Catalogue. Compliance with a British Standard does not of itself confer immunity from legal obligations. Summary of pages This document comprises a iront cover, an inside hnt cover, the ISO/IEC tit
6、le page, pages ii to xi, a blank page, pages 1 to 135 and a back cover. This British Standard having been prepared under the direction of the DISC Board, was published under the authority of the Standards Board and comes into effect on i5 August 1997 0 BSI 1997 ISBN O 680 27232 X Amendments issued s
7、ince publication Amd No. ID& ITkxtaffected STD*BSI BS ISO/IEC 23522-3-ENGL 1997 lb24bb7 Ob403b5 827 W BS ISO/IEC 13522-3 : 1997 I NT E R NAT I O NA L STANDARD ISO/IEC 13522-3 First edition 1997451 5 Information technology - Coding of multimedia and hypermedia information - Part 3: MHEG script interc
8、hange representation Technologies de linformation - Codage de linformation rnuitirndia et h ypermdia - Parte 3: Reprsentation dinterchange script MHEG - Reference number ISO/IEC 13522-3:1997(E) STD*BSI BS ISO/IEC 13522-3-ENGL 1997 = Lb24bb9 Ob403bb 753 BS ISOAEC 13522-3 : 1997 Contents Scope 1 1.1 C
9、ontext of the scope . 1 1.2 Scope of this part of ISOIIEC 13522 1 Normative ref e rences . 1 Definitions 2 Abbreviations . 6 Conformance . 7 5.1 Information object conformance 7 5.1.1 Profiles 7 5.1.2 Encoding . 7 5.1.3 Syntax . 8 5.1.4 Semantics . 8 5.2 Implementation conformance 8 5.2.1 Conformanc
10、e requirements . 8 5.2.2 Conformance documentation . 8 5.3 Application conformance . 9 5.4 Test Methods 9 Overview . 9 6.1 Description methodology . 9 6.2 Data processing operations 1 0 6.3 Access to external data and functions 1 0 MHEGNHEG-3 relationship . 11 7.1 MHEG entities 1 1 7.2 Functional en
11、tities 1 1 7.3 MHEG-SIR script interpreter . 12 Elements of MHEG-SIR 12 0.1 Data types i 2 8.1.1 Predefined types . i 3 8.1.1.1 Primitive types . 13 8.1.1.1.1 . void type 14 8.1.1.1.2 octet type 14 8.1.1.1.3 short type 14 unsigned short type 14 8.1.1.1.4 long type 14 8.1.1.1.5 Descriptors: data proc
12、essing. video data. audio data. graphic data processing. image processing. information interchange . communicat procedure. :oding (data conversion). coded representation . ii STD-BSI BS ISOIIEC L3522-3-ENGL 1797 D lb24bb9 Ob1i03b7 b9T D BS ISOAEC 13522-3 : 1997 8.1.2 8.1.1 . 1.6 unsigned long type 1
13、4 8.1.1.1.7 float type 14 8.1.1.1.8 double type 14 8.1.1.1.9 boolean type 14 8.1.1.1.1 O character type 14 8.1.1.1.11 data identifier type . 14 8.1.1.1.12 object reference type . 15 8.1.1.2 Predefined constructed types . 15 Declared WnStruCted types . 15 8.1.2.1 sequence types 15 8.1.2.2 string type
14、s . 16 8.1.2.3 array types 16 8.1 2.4 structure types 17 8.1.2.5 union types . 17 8.2 Data . 17 8.2.1 Immediate values . 18 8.2.2 Constants . 18 8.2.3 Variables 18 8.2.3.1 Global variables 19 8.2.3.2 Local variables . 19 8.2.3.3 Dynamic variables 19 8.3 Functions 19 8.3.1 Routines . 20 8.3.2 Service
15、s . 20 8.3.3 Predefined functions 21 8.4 Messages . 21 8.4.1 Package exceptions . 21 8.4.2 Predefined messages 22 8.5 Instructions . 22 8.6 Idenufiers 22 8.6.1 Type identifiers . 22 8.6.2 Data identifiers . 23 8.6.3 Function identifiers . 23 8.6.4 Message identifiers 23 9 The MHEG-SIR virtual machin
16、e . 23 9.1 9.2 Structure of the MHEG-SIR virtual machine . 24 Structures and notations . 24 9.2.1 Table . 24 9.2.2 Stack . 24 9.2.4 Queue 25 9.2.5 Data representation . 25 9.3 Memory areas . 26 9.3.1 Mh-script memory areas 26 9.3.1.1 Data areas 27 9.3.1.1.1 Type definition table 27 9.3.1.1.2 Constan
17、t table . 27 9.3.1.1.3 Global variable definition table 27 Code areas . 27 9.3.1.2.1 Routine definition table 27 9.3.1.2.2 Package definition table 28 9.3.1.2.3 Service definition table 28 9.3.1.2.4 Exception definition table . 28 9.3.1.2.5 Handler definition table 29 9.3.1.2.6 Program code area 29
18、9.2.3 Parameter stack . 25 9.3.1.2 iii STD*BSI BS ISOIIEC L3522-3-ENGL 1977 Lb24bb9 Ob403bB 52b BS ISO/IEC 13622-3 : 1997 9.3.2 Rt-script memory areas 29 9.3.2.1 Dynamic memory areas 29 9.3.2.1.1 Variable table . 29 9.3.2.1.2 Call stack 30 9.3.2.1.3 Parameter stack . 30 9.3.2.1.4 Message queue . 31
19、9.3.2.1.5 Heap . 31 Instruction pointer register . 32 9.3.2.2.2 Instruction register . 32 Stack pointer register . 32 9.3.2.2 Registers 31 9.3.2.2.1 9.3.2.2.3 Error register 32 9.3.2.2.4 9.3.2.2.5 Frame painter register . 32 9.3.2.2.6 Queue pointer register . 32 9.3.2.2.7 Function register 32 9.4 Sc
20、ript statuses 33 9.4.1.2 Available . 33 9.4.2.1 Not ready . 33 9.4.2.2 Ready 33 9.4.2.3 Running 34 9.4.2.4 Erroneous . 34 9.5 Processing units . 34 9.5.1 Message reception . 34 MHEG-3 API operations . 34 9.4.1 Mh-script statuses 33 9.4.1.1 Not available . 33 9.4.2 Rt-script statuses . 33 9.5.1.1 9.5
21、.1.2 External exception 34 9.5.1.3 InstructionExecutionError exception . 35 9.5.2 Mh-script initialisation . 35 9.5.3 Rt-script initialisation 35 Rt-script execution unit . 36 MHEG-SIR instruction execution unit . 36 Provisions for run-time environment access 36 Invocation of external operations in
22、an MHEG-SIR program 38 Handling of external exceptions in an MHEG-SIR program . 38 Invocation of extemal operations by an MHEG-3 engine . 38 9.5.1.4 MHEG-3 API exception 35 9.5.4 9.5.5 10 10.1 General model 36 10.2 Declaration of IDL interfaces 37 10.3 10.4 10.5 10.6 Handling of external exceptions
23、by an MHEG-3 engine . 38 10.7 Platform mapping specifications . 39 Provisions for MHEG object manipulation 39 11 . 1 Invoking MHEG actions 39 11.1.1 Sending messages to other scripts 39 11.1.2 Receiving MHEG messages . 40 11.2.1 11.2.2 MHEG API exceptions 40 11 Exchange of information with MHEG obje
24、cts . 40 MHEG-3 API run operations . 40 11.2 12 MHEG-SIR declarations . 40 12.1 Type declaratbn 41 12.1.1 Type identifier . 41 12.1.2 Type description . 41 . iv . * m * . STD-BSI BS ISO/IEC 13522-3-ENGL 1797 1b2LibbS Ob403b7 gb2 BS ISOAEC 13522-3 : 1997 12.2 12.3 12.4 12.5 12.6 12.1.2.1 String descr
25、iption 42 12.1.2.2 Sequence description . 42 12.1.2.3 Array description 42 12.1.2.4 Structure description 42 12.1.2.5 Union description 42 Constant declaration . 43 12.2.1 Data identifier . 43 12.2.2 Type identifier . 43 12.2.3 Constant value . 43 Global variable declaration . 44 12.3.1 Data identif
26、ier . 44 12.3.2 Type identifier . 44 12.3.3 Constant reference 44 Package declaration . 45 Package identifier . 45 12.4.1 12.4.2 Name 45 12.4.3 Service description . 45 12.4.3.1 Function identifier . 45 12.4.3.2 Name 46 12.4.3.3 Calling mode 46 12.4.3.4 Type identifier . 46 12.4.3.5 Parameter descri
27、ption 46 12.4.3.5.1 Passing mode 46 Type identifier 47 12.4.3.5.2 12.4.4 Exception description . 47 12.4.4.1 Message identifier 47 12.4.4.2 Parameter description 47 Handler declaration 47 12.5.1 Message identifier 48 12.5.2 Function identifier . 48 Routine declaration . 48 12.6.1 Function identifier
28、 . 48 12.6.2 Type identifier . 48 12.6.3 Parameter description 48 Passing mode . 49 12.6.3.1 12.6.3.2 Type identifier . 49 Local variable declaration 49 12.6.4.1 Data identifier . 49 12.6.4.2 Type identifier . 49 12.6.4.3 Constant reference . 49 12.6.5 Program code 50 12.6.4 13 MHEG-SIR instructions
29、 50 13.1 Presentation methodology 50 13.1.1 Error conditions 50 13.1.2 Formal specification . 51 13.1.3 Data table notation . 51 13.1.4 Template instruction notation . 51 13.1.5 Primitives 52 Classification of MHEG-SIR instructions 52 Description of instructions 54 13.3.1 No operation . 54 13.3.2 Yi
30、eld 54 13.3.3 Return 54 13.3.4 Free . 55 13.3.5 Not . 55 13.2 13.3 V STDIBSI BS ISOIIEC 13522-3-ENGL 1777 LbZqbb7 Ob40370 LB4 BS ISO/IEC 13622-3 : 1997 13.3.6 13.3.7 13.3.8 13.3.9 13.3.1 O 13.3.1 1 13.3.12 13.3.13 13.3.14 13.3.15 13.3.16 13.3.1 7 13.3.18 13.3.19 13.3.20 13.3.21 13.3.22 13.3.23 13.3.
31、24 13.3.25 13.3.26 13.3.27 13.3.28 13.3.29 13.3.30 13.3.31 13.3.32 13.3.33 13.3.34 13.3.35 13.3.36 13.3.37 13.3.38 13.3.39 13.3.40 13.3.41 13.3.42 13.3.43 Or . 56 Exclusive or 56 And 57 Equal reference 57 Equal . 58 Less than 58 Greater than . 59 Add 59 Subtract 59 Multiply . 60 Divide . 60 Negate 6
32、1 Duplicate 62 Jump on true 62 Jump on false . 63 Jump . 63 Shift . 64 Long jump on true 65 Call . 66 External call 67 Push 68 Pop 70 Pop reference . 70 Pop contents 70 Allocate . 71 Increment . 71 Decrement 72 Get 72 Remainder 61 Convert . 62 Get object reference . 64 Long jump on false . 65 Long i
33、ump . 65 Push reference . 69 Push immediate 69 Get contents . 73 Set . 74 Set contents . 75 - 13.4 Type conversion rules . 13 13.4.1 Reversible conversions 76 Lossless extensions . 13.4.2 76 13.4.2.1 13.4.2.2 Conversions from octet to a numeric type 76 13.4.2.3 Lossless conversions from a numeric to
34、 a larger numeric type . 76 13.4.3 Lossy extensions 77 13.4.4 Truncations to boolean . 77 13.4.5 Truncations between integer or between floating-point types 77 13.4.6 Conversions from boolean 76 Truncations from floating-point to integer . 77 14 IDL mapping to MHEG-SIR 77 14.2 14.1 IDL specification
35、s 77 IDL interfaces and modules 78 14.3 IDL operations 78 14.3.2 Operation parameters 78 14.3.1 Operation name 78 vi STD=BSI BS ISO/IEC 13522-3-ENGL 1777 m lb24bb9 Ob40371 O10 BS ISO/IEC 13522-3 : 1997 14.3.3 Implicit parameter . 78 14.3.4 Return value . 78 14.4 IDL attributes 78 14.4.2 Modifier 79
36、IDL inherited operations . 79 14.6.1 14.6.2 14.6.3 14.4.1 Accessor 79 14.4.3 Readonly attribute 79 14.6 IDL exceptions 79 Exception name . 79 Exception members . 79 Implicit member 79 14.7.1 char type 80 14.7.2 enum type 80 Restrictions on types 81 14.5 14.7 IDL types 80 14.7.3 Constructed types 80
37、14.7.4 any type . 81 14.7.5 14.8 IDL constants 81 15 The MHEG-3 API . 81 15.1 Scriptlnterpreter object . 81 15.1.1 kill operation . 82 15.1.2 prepare operation . 82 15.2 MhSctipt object . 83 15.2.1 destroy operation . 83 15.2.2 new operation . 83 15.3 RtScript object 84 15.3.1 delete operation . 84
38、15.3.2 setPriority operation . 84 15.3.3 getpriority operation . 84 15.3.4 setData operation . 85 15.3.5 getData operation . 85 15.3.7 free operation . 86 15.3.8 stop operation 87 15.3.9 relnit operation . 87 15.3.1 O getRtScriptStatus operation . 88 15.3.1 1 open operation . 88 15.4 RoutineInvocati
39、on object 88 15.4.1 close operation . 88 15.4.2 routine-id readonly attribute . 89 15.4.3 SetParameter operation . 89 15.4.4 getProtoype operation . 90 15.4.5 run operation 90 15.4.6 reset operation . 91 15.4.7 getlnvocationStatus operation . 91 15.3.6 allocate operation . 86 Annex A (normative) ASN
40、.l specification of interchanged scripts 92 Annex B (normative) Coded representation of interchanged scripts 95 B.l Coding for interchanged scripts . 95 8.2 Coding for the program code . 95 6.2.1 Instruction opcodes . 95 6.2.2 Instruction operands . 95 vii STD-BSI BS ISOIIEC 13522-3-ENGL 1997 W Lb24
41、bb9 Ob90372 T57 BS ISO/IEC 13622-3 : 1997 B.2.2.1 8.2.2.2 8.2.2.3 Data identifier operands . 95 Function identifier operands . 95 Miscellaneous numeric operands . 96 Annex C (normative) MHEG-SIR predefined elements . 161 C.l Predefined types 101 C . 1.1 C.1.2 Primitive types 101 MHEG API types . 102
42、 C.2 Predefined functions. 102 MHEG API operations 102 MHEG-3 API operations . 102 MHEG-3 API operations . 103 The InstructionExecutionError exception 103 MHEG-3 API exceptions . 104 MHEG API exceptions 104 Annex D (normative) IDL Platform mapping specification form . 105 Platform description 105 Pa
43、ckage availability procedure . 105 Package load procedure . 105 Operation invocation procedure Parameter passing procedure 105 Output parameter retrieval procedure . 105 Return value retrieval procedure 106 Data encoding rules 106 Exception retrieval procedure . Resource limitations . 106 C.2.1 C.2.
44、2 (2.3 Predefined messages 103 C.3.1 C.3.2 C.3.3 C.3.4 Package unload procedure . 105 105 106 System exceptions 106 Annex E (normative) MHEG API definition process . 107 E.1 Generic API definition framework 107 E.l. 1 E.? . 2 E.1 . 3 MHEG elements input to MHEG API definition process 107 IDL element
45、s output by MHEG API definition process 107 Requirements on the MHEG API definition process 107 E.1.3.1 Portability 108 E.1.3.2 Genericity . 108 E.1.3.3 Conformance testability 108 E.1.3.4 Implementability . 108 General structure of the MHEG API 109 E.1.5.1 Name mapping . 109 E . 1.3.5 Fulfilment of
46、 technical requirements . 108 IDL nonobject datatype definition . 109 E.1.5.1.1 Data types 109 E.1.5.1.2 Components . 109 E . 1.5.1.3 Values . 110 E . 1 5.2 Type mapping 110 E.1.4 E.1.5 . E.1.5.2.1 INTEGER 110 BOOLEAN 110 E.1.5.2.3 OCTET STRING . 111 E.1.5.2.4 ENUMERATED 111 E.? 52.2 viii . STD-BSI
47、BS ISO/IEC 13522-3-ENGL 1977 1b24bb9 Ob40373 993 BS ISOAEC 13522-3 : 1997 E . 1.5.2.5 SEQUENCE OF . 1i1 E . 1.5.2.6 CHOICE . 111 E.1.5.2.7 SEQUENCE . 112 E . 1 53 Order of declarations . 112 IDL interface definition . 114 IDL attribute definition 114 E.1.7.1 MHEG interchanged attributes . 114 E.1.7.
48、2 MHEG internal attributes 115 IDL operation definition 115 E.1.8.1 Operations mapping MHEG elementary actions 115 E . 1.8.2 Operations enabling the deletion of an interface instance . 116 E.1.8.3 Operations to attach and detach an interface instance to a MHEG entity . 117 IDL exception definition .
49、 117 E.1.6 E.1.7 E.1.8 E.1.9 E.2 MHEG API mapping to MHEG-SIR . 118 Annex F (normative) IDL specification of the MHEG-3 API . 119 Annex G (normative) Relationships with other parts of ISOIIEC 13522 . 121 G.1 Relationships with ISO/IEC 13522-1 121 G.2 Relationships with ISO/IEC 13522-5 122 Annex H (informative) MHEG-SIR syntax (EBNF notation) 123 Annex J (informative) Textual notation for MHEG-SIR scripts 125 Annex K (informative) MHEG entities 128 K.l MHEG objects 128 K.2 Mh-objects . 128 K.3 Rt-objects . 128 K.4 Interchanged MHEG obje