### Basics of Integration using Monte Carlo

Recently, someone asked me about Monte Carlo. So, I thought I should write this post to provide a basic introduction of performing integration using Monte Carlo. "Why integration?", you asked. Well, this is because integration is one of the main operations done in computing the posterior probability distributions used in machine learning and probabilistic filtering (e.g. Bayes filter). For example, consider the typical posterior probability expression in the Bayes filtering context, $$p(x_{t} \mid y_{1:t})$$, i.e. the probability of hidden state $$x_{t}$$ given the observed sequence of measurements up to the current time point $$y_{1:t}$$, $$p(x_{t} \mid y_{1:t}) = \frac{p(y_{t} \mid x_{t}) p(x_{t} \mid y_{1:t-1})}{p(y_{t} \mid y_{1:t-1})}$$ The $$p(x_{t} \mid y_{1:t-1})$$ is of particular interest. It can be seen as the prediction of $$x_{t}$$ from previous observations $$y_{1:t-1}$$ and can be expressed as p(x_{t} \mid y_{1:t-1}) = \int p(x_{t} \mid x_{t-1}) p(x_{t-1}

### PPA for radeon vdpau gallium drivers (Ubuntu 13.04)

Update (Recommended): If you want, you can use Oibaf's ppa as mesa 9.2+ comes with numerous performance gains for the open-source radeon drivers. Just remember to install libg3dvl-mesa for hardware accelerated video playback instead of libvdpau1-gallium-drivers.

Seeing that no one has created deb packages addressing the latest patches with regards to support of VDPAU on the open-source radeon drivers, I have built mesa-9.1.3-6 with these patches and uploaded them to my PPA. This should make is easy for anyone interested in enabling hardware-accelerated video playback without the usual compiling and installing from source which would otherwise mess with files referenced by the default mesa packages on Ubuntu. The following instructions assume you have at least Linux 3.10 installed. Otherwise, download and install them from here.

sudo mv /lib/firmware/{radeon,radeon_bak} # Backup
sudo cp <path to bins>/*.bin /lib/firmware/radeon/

Once you have done that, enabling hardware-accelerated playback is as simple as typing and executing the following on the command line:
sudo add-apt-repository ppa:mysticalzero/radeon-vdpau-gallium # Add ppa
sudo apt-get update && sudo apt-get upgrade
sudo apt-get install libvdpau1-gallium-drivers vdpauinfo

If everything is installed properly, you should see the following under "Decoder capabilities" upon executing vdpauinfo.
Decoder capabilities:

name               level macbs width height
-------------------------------------------
MPEG1                16  9216  2048  1152
MPEG2_SIMPLE         16  9216  2048  1152
MPEG2_MAIN           16  9216  2048  1152
H264_BASELINE        16  9216  2048  1152
H264_MAIN            16  9216  2048  1152
H264_HIGH            16  9216  2048  1152
VC1_SIMPLE           16  9216  2048  1152
VC1_MAIN             16  9216  2048  1152



Now, try playing back some h264 content on any VDPAU-compatible player (e.g. mplayer -vo vdpau -vc ffh264vdpau <filename>).

1. hi,, what about ubuntu 12.04? can i use this way?

1. For 12.04, everything's the same. But you HAVE to use Oibaf's PPA instead of mine.

2. $dpkg --list | grep vdpau ii libvdpau1:amd64 0.4.1-8 amd64 Video Decode and Presentation API for Unix (libraries) ii libvdpau1-gallium-drivers:amd64 9.1.3-7ubuntu0.3ppa1~raring1 amd64 VDPAU Gallium3D video acceleration drivers ii vdpauinfo 0.0.6-1 amd64 Video Decode and Presentation API for Unix (vdpauinfo utility)$ uname -a; cat /etc/lsb-release
Linux phong 3.10.10-031010-generic #201308291422 SMP Thu Aug 29 18:24:39 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=13.04
DISTRIB_CODENAME=raring
DISTRIB_DESCRIPTION="Ubuntu 13.04"

$dmesg|grep VERDE [ 14.727922] [drm] initializing kernel modesetting (VERDE 0x1002:0x683F 0x1043:0x0459). [ 15.149522] [drm] Loading VERDE Microcode$ vdpauinfo
display: :0 screen: 0
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Error creating VDPAU device: 1

What am I getting wrong here?

1. The backend selection for the radeonsi vdpau drivers in mesa 9.1.3.x is most likely not implemented properly. I recommend using packages from Oibaf's PPA.