Today I wrote a function alike (delay proc) from my memory.
(define (memproc proc)
(let ((read? #f)
(result #f))
(lambda ()
(if read?
result
(begin
(set! result (proc))
(set! read? #t)
result)))))
It is not easy to implement the above function in C or C++ programming language. Perhaps, you
have to use a global variable or define a pointer to a funtion, even make a special class. However,
it is so natural and simple in lisp.
This afternoon I read some aticles on MPEG4. I learned some concepts from them. All MPEG films
are made from a sequence of pictures. So, experts call those pictures as frames. They also divide
a picture into more blocks, the blocks are all 16x16. The encoding or decoding must be based on these
blocks.
There are three kinds of frame, I-frame, P-frame, B-frame. The I-frame is a key frame. In order
to compress much data, in MPEG4, it is not true that all frames are real pictures. As a matter of fact,
some frame just save little key data so as to decrease a film file size. But we still need frames for
making those virtual frames based on them. These frames are called key frames, I-frames. It usualy
is the head of a GOP (Group of Picture). If you know what is I-frame, the P-frame and B-frame will be
easy to understand.
The P-frame is just to save different data from its previous frame which maybe a I-frame or not. The
B-frame is used to save data different from its previous frame or its next frame.
You can think P-frame and B-frame both virtual frames