In this scene, Sam (Sean Astin) and Frodo (Elijah Wood) discover and capture Gollum (Andy Serkis). After the scene was filmed, Computer Generated Imagery (CGI) was applied to Andy's performance to create the final appearance of Gollum.
From "Gollum" by Andy Serkis:
In the fight sequence between Gollum, Frodo and Sam, Pete wanted to use the takes where I actually was on screen fighting, with my body wrapped around Sean's as he struggled to break free, to ensure the energy and contact felt real, and so the painstaking method of rotoscoping was employed. The roto-artists literally drew in Gollum's skinny body over my exact movements and then painted out the excess fat (me) frame by frame. It was very time-consuming, precise procedure, but nevertheless, the right choice for the shot.