View Full Version : reference of intra&inter macroblock
angelzhang
11th January 2005, 02:38
hi,experts
who can tell me concrete reference rule of intra macroblcok and inter macroblock? questions as following:
1)Macroblocks' prediction in I frame can only take macroblock in the same slice as reference, then when one frame has two slices, then does macroblock in one slice can take the macroblock in another slice of the same frame as reference?
2)P frame can have intra macroblock and inter macroblock. as far as inter macroblock is concerned,does it only take macroblocks in other frames decoded before as reference? or other rule? and what about reference of intra macroblocks in the P frame?
I am confused very much, please give me some suggestions!
thanks in advance
BR
angel
akupenguin
11th January 2005, 07:16
Intra prediction may not use blocks in other slices. They are considered unavailable, just like at the edge of the frame.
Inter prediction may not reference other blocks in the same frame.
angelzhang
11th January 2005, 09:43
hi,akupenguin
thank you for your reply, then can intra macroblock of one P slice take inter macroblock in the same P slice as reference?
and we get the conclusion that intra predition is done based on slice unit,but inter prediction is done based on frame unit.
Intra macroblock in one frame which have two slices can only take macroblock in the same slice other than another slice as reference.
Inter macroblock in one frame which have two sices can only take refrence macroblock of other frame other than that in the same frame.
is it right?
best regards
angel
akupenguin
11th January 2005, 10:54
Originally posted by angelzhang
then can intra macroblock of one P slice take inter macroblock in the same P slice as reference? yes.
and we get the conclusion that intra predition is done based on slice unit, but inter prediction is done based on frame unit. Your summary is correct. But note that inter blocks are also affected by slice boundaries: Normally the motion vectors are predicted based on neghboring inter blocks (saves a few bits by storing only the difference between predicted and actual MV). But that prediction does not use blocks in other slices.
shlezman
11th January 2005, 12:52
[QUOTE]Originally posted by akupenguin
[QUOTE]Originally posted by angelzhang
[B]then can intra macroblock of one P slice take inter macroblock in the same P slice as reference?.
[B]yes.
unless the prediction MB is inter (P) and the constrained_intra_pred_flag is set
akupenguin
11th January 2005, 14:02
Originally posted by shlezman
unless the prediction MB is inter (P) and the constrained_intra_pred_flag is set If you want to view that as a constraint, I guess so. But I read it more as: You can choose not to use P-blocks as prediction for I-blocks, and you can inform the decoder of that decision so that it may be able to optimize accordingly. Same with direct_8x8_inference_flag.
gurpreet1989
4th March 2011, 11:59
hello all
please tell me about the macroblocks..........
I know group of pictures contain number of pictures and one picture contains number of slices and one slice contains number of macroblock
but I want to know about starting byte of macroblock and number of bytes in it. please give me the details about this if you have any documents for this please send it on my email id : gpsm1989@yahoo.com
imcold
6th March 2011, 15:08
Macroblock data is located right after the slice header, there's no starting byte. You can get the number of *bits* in each macroblock by parsing the bitstream - reading the mb type/prediction data/residual/etc according to the specification of given standard.
gurpreet1989
7th March 2011, 06:34
thanx imcold
i know about the slice header there is four byte of slice header 00000101-000001AF ok after this there is 5 bits of quantizer scale. know tell me where is the actual data of macroblock i gave you example here.and tell me in details please
and one thing more tell me about the number of macroblock in a slice and number of slices in one picture frame also tell me about number of gop in one mpeg and number of frames in one mpeg file........please reply
00 00 00 00 01 01 0B F8 7E 5D 3A A8 CD 4E A8 66
AF 67 B9 C8 F4 A7 EF 4F A3 E8 6B 86 D1 A8 75 37
23 C3 B4 7B 94 F8 89 4F 85 51 A3 C3 BD C7 A6 CC
78 E6 A7 DA 8C C1 73 78 EA B8 EC 15 46 3C 3A 9C
0E D3 69 43 3D CD 45 D1 A8 CF 07 45 CE AA 0B 1F
46 6E B3 A9 B3 C1 E1 50 CC 04 09 F7 15 E9 D5 A8
DB D2 34 05 11 FB DC CA A6 EE 1E 7D 36 A6 46 8F
0C 41 B9 B9 16 9B 6A 35 18 C8 3E 0E 22 5C D4 3E
83 36 A4 43 0A B9 9B 53 F2 00 75 32 A9 A1 A1 F0
11 3A E1 F4 7A 35 19 C0 3F 83 E2 E1 E7 D1 DA 9D
74 6D A0 ED EB B9 BB 91 E9 FB D1 9A 91 1E E7 CF
43 89 F4 67 01 65 3E 88 FA E3 7F 4F 9E 8C E4 4A
6C E2 23 C3 35 CF DA 9A 9F 31 1E 9B 00 79 0D 1A
E6 6E 47 0F A6 CF 4F 83 E9 95 37 78 CD AE 1E D4
77 10 7E A6 F4 D8 3A 5B 41 D7 37 70 B8 B3 36 72
3D 1D F0 98 8D 00
PLEASE RPLY
imcold
7th March 2011, 13:58
Read 5 bits - Qscale equals 1 in your case (top 5 bits from 0x0B), read 1 bit - extra_bit_slice - it's 0, so no extra bits follow. There starts the MB layer and the data you're looking for.
Did you read the spec? What are you trying to achieve anyway?
gurpreet1989
8th March 2011, 06:01
thanx for reply
you means macroblock layer starts from(11) 0000 1011 ....now please tell me length of first macroblock.....and how to divide into blocks.
I am doing research work on mpeg video file for my major project....
please show a 16x16 pixel macroblock with example and another details with example...
if you have any documentry please send me on my email id
gpsm1989@yahoo.com
THANKS A LOT
gurpreet1989
8th March 2011, 06:12
if you need sequence header then here is the sequence header
00 00 01 B3 16 00 F0 E4 03 6B 20 A1 10 11
IN RED IT IS A HORIZONTAL SIZE AND IN BLUE IS A VERTICAL SIZE PLEASE REPLY
gurpreet1989
24th March 2011, 06:50
imcold
please reply
imcold
25th March 2011, 08:57
As I see it, you have 3 options:
1. parse the stream manually by following the spec (no, I'm not going to do this for you)
2. take an opensource mpeg decoder and follow the bitstream parsing flow
3. use a stream analyzer
gurpreet1989
4th May 2011, 09:10
can anyone tell me IS mpeg(0xBA, 0xBB, 0xB8..............) Header are in compressed form or not..........If they are in compressed form then is there any software to decompress the mpeg file?
please reply.....
neuron2
4th May 2011, 15:50
@gurpreet1989
You've hijacked this thread and taken it off topic. Stop posting in this thread unless it is on topic for the thread (refer title and original post).
Your basic questions are all answered in the MPEG specification. Go read it!
gurpreet1989
5th May 2011, 06:05
okay neuron......
but no one is here for replying my messages........will you give me the path where i find all the answers of my questions...............I made a account on this page because i think i helps me a lot but no one have any answer to reply my threads.....totaly time wasting
neuron2
5th May 2011, 15:54
You have received lots of answers in this and your other hijacked thread, but you're unable to understand or act upon them.
Followup to PM if you need to discuss this further.
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.